Skip to content

[Ref Mode] PyTorch reference mode (eager only) #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

yf225
Copy link
Contributor

@yf225 yf225 commented Jul 20, 2025

Stacked PRs:


[Ref Mode] PyTorch reference mode (eager only)

Part of #77.
Please see inline code comments on the PR.

yf225 added a commit that referenced this pull request Jul 20, 2025
stack-info: PR: #339, branch: yf225/stack/34
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 20, 2025
yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77.

stack-info: PR: #339, branch: yf225/stack/34
)

# Step 3: Handle block_size (in ref mode, full dim size is always used as block_size)
block_size_list = [None] * len(end_list)
Copy link
Contributor Author

@yf225 yf225 Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use full dim size in ref modes regardless of block_size value

@yf225 yf225 requested review from jansel, oulgen, drisspg and joydddd July 20, 2025 23:50
class TestExamplesRefCompile(test_examples.TestExamples):
"""Run all TestExamples tests in reference torch.compile mode via HELION_REF_COMPILE=1."""

# NOTE: All tests in TestExamples are run in ref torch.compile(fullgraph=True) mode by default in this test file.
Copy link
Contributor Author

@yf225 yf225 Jul 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently all examples in TestExamples pass with ref eager mode and ref compile mode.

Planning to add more ref mode unit tests to cover test_reduce.py, test_associative_scan.py etc. in the next PR.

yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77. Please see
inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 20, 2025
Fixes #77.
Please see inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 21, 2025
Fixes #77.
Please see inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 21, 2025
Fixes #77.
Please see inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 21, 2025
Fixes #77.
Please see inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
yf225 added a commit that referenced this pull request Jul 21, 2025
Fixes #77.
Please see inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 26, 2025 19:56
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 26, 2025 19:56
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 26, 2025 20:07
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 26, 2025 20:07
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 26, 2025 21:01
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 26, 2025 21:01
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 26, 2025 22:30
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 26, 2025 22:31
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 26, 2025 23:24
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 26, 2025 23:24
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 26, 2025 23:30
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 26, 2025 23:30
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 27, 2025 00:03
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 27, 2025 00:03
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 27, 2025 02:40
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 27, 2025 02:41
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 27, 2025 04:53
@yf225 yf225 changed the base branch from main to yf225/stack/39 July 27, 2025 04:53
Part of #77.
Please see inline code comments on the PR.

stack-info: PR: #339, branch: yf225/stack/34
@yf225 yf225 changed the base branch from yf225/stack/39 to main July 28, 2025 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants