Skip to content

Conversation

@jansel
Copy link
Contributor

@jansel jansel commented Nov 14, 2025

Stacked PRs (oldest at bottom):


Auto-select index_dtype

Fixes #1123

jansel added a commit that referenced this pull request Nov 14, 2025
Fixes #1123

stack-info: PR: #1131, branch: jansel/stack/227
This was referenced Nov 14, 2025
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 14, 2025
jansel added a commit that referenced this pull request Nov 14, 2025
Fixes #1123

stack-info: PR: #1131, branch: jansel/stack/227
jansel added a commit that referenced this pull request Nov 14, 2025
Fixes #1123

stack-info: PR: #1131, branch: jansel/stack/227
@Chillee
Copy link

Chillee commented Nov 14, 2025

I think it's worth distinguishing what's happening at what component. For example, if I use kernel.bind will it automatically re-specialize? I guess if I do kernel.bind and pass in new inputs it won't re-specialize?

jansel added a commit that referenced this pull request Nov 14, 2025
Fixes #1123

stack-info: PR: #1131, branch: jansel/stack/227
@jansel jansel changed the base branch from jansel/stack/226 to main November 14, 2025 04:50
@jansel
Copy link
Contributor Author

jansel commented Nov 14, 2025

I think it's worth distinguishing what's happening at what component. For example, if I use kernel.bind will it automatically re-specialize? I guess if I do kernel.bind and pass in new inputs it won't re-specialize?

kernel.bind() specializes on numel>=2**31 if index_dtype=None. So you will get an automatic recompile if the kernel inputs cross that boundary. If you do @helion.kernel(index_dtype=torch.int64, static_shapes=False) it won't specialize.

If you manually call kernel.bind(), you must manually guarantee all inputs you pass to the BoundKernel have the same specialization_key.

This PR also updates the docs. Do you find the docs clear?

Fixes #1123

stack-info: PR: #1131, branch: jansel/stack/227
@Chillee
Copy link

Chillee commented Nov 14, 2025

How do I figure out the specialization key for a set of inputs?

@jansel
Copy link
Contributor Author

jansel commented Nov 14, 2025

kernel.specialization_key([a, b, c]) in code and there is discussion of it in https://helionlang.com/deployment_autotuning.html

@jansel jansel merged commit 5872294 into main Nov 14, 2025
16 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.

Use int64 indexing automatically in helion.

4 participants