Skip to content

Support range() loops (alias for hl.grid) #212

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

Merged
merged 1 commit into from
Jun 21, 2025
Merged

Support range() loops (alias for hl.grid) #212

merged 1 commit into from
Jun 21, 2025

Conversation

Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel force-pushed the jansel/stack/63 branch from ed8658b to cf606d1 Compare June 21, 2025 05:02
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 21, 2025
@jansel jansel changed the base branch from jansel/stack/62 to main June 21, 2025 14:12
@jansel jansel force-pushed the jansel/stack/63 branch from cf606d1 to fedc1dc Compare June 21, 2025 14:12
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel changed the base branch from main to jansel/stack/62 June 21, 2025 14:13
@jansel jansel changed the base branch from jansel/stack/62 to main June 21, 2025 15:06
@jansel jansel changed the base branch from main to jansel/stack/62 June 21, 2025 15:07
@jansel jansel requested a review from yf225 June 21, 2025 16:58
@@ -118,7 +118,7 @@ def fn(x: torch.Tensor) -> torch.Tensor:
batch = x.size(0)
out = x.new_empty(batch)
for tile_batch in hl.tile(batch):
for i in range(10):
for i in [1, 2, 3]:
Copy link
Contributor

Choose a reason for hiding this comment

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

does this mean the literal [1,2,3] is not supported? should we support it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, it is not supported. We could support it by unrolling the loop, not sure if it is allowd in Triton.

@jansel jansel force-pushed the jansel/stack/62 branch from 8d4e179 to 6c97dca Compare June 21, 2025 18:11
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel force-pushed the jansel/stack/63 branch from fedc1dc to fedab8f Compare June 21, 2025 18:11
@jansel jansel force-pushed the jansel/stack/62 branch from 6c97dca to ab7ddd7 Compare June 21, 2025 18:13
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel force-pushed the jansel/stack/63 branch from fedab8f to a0c300e Compare June 21, 2025 18:13
@jansel jansel force-pushed the jansel/stack/62 branch from ab7ddd7 to 751b0c5 Compare June 21, 2025 18:15
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel force-pushed the jansel/stack/63 branch from a0c300e to 3e7f664 Compare June 21, 2025 18:15
@jansel jansel force-pushed the jansel/stack/62 branch from 751b0c5 to 2c45605 Compare June 21, 2025 18:16
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel force-pushed the jansel/stack/63 branch from 3e7f664 to b359ddc Compare June 21, 2025 18:16
@jansel jansel force-pushed the jansel/stack/62 branch from 2c45605 to 030df03 Compare June 21, 2025 18:17
jansel added a commit that referenced this pull request Jun 21, 2025
Fixes #207

stack-info: PR: #212, branch: jansel/stack/63
@jansel jansel force-pushed the jansel/stack/63 branch 2 times, most recently from 90e4ae7 to e56d028 Compare June 21, 2025 18:18
@jansel jansel changed the base branch from jansel/stack/62 to main June 21, 2025 18:18
@jansel jansel merged commit dbcf355 into main Jun 21, 2025
3 checks passed
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.

Add support for for _ in range() in device code
4 participants