Skip to content

[triton][beta] Fix smem_budget query for offline compilation#1104

Open
Sibylau wants to merge 2 commits intofacebookexperimental:mainfrom
Sibylau:export-D97003359
Open

[triton][beta] Fix smem_budget query for offline compilation#1104
Sibylau wants to merge 2 commits intofacebookexperimental:mainfrom
Sibylau:export-D97003359

Conversation

@Sibylau
Copy link
Copy Markdown
Contributor

@Sibylau Sibylau commented Mar 18, 2026

Summary:
D95898963 added smem_budget as a parameter to add_hopper_warpspec, querying it via rt_driver.active.utils.get_device_properties(). This requires a live GPU driver, but Triton CC compiles kernels on RE (remote execution) where no GPU is available, causing RuntimeError: 0 active drivers.

In addition to D96671173, this diff tries querying the GPU driver first and falls back to a static lookup table when no driver is available. The fallback values are CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN per the CUDA Programming Guide.

Reviewed By: njriasan

Differential Revision: D97003359

Summary:
D95898963 added `smem_budget` as a parameter to `add_hopper_warpspec`, querying it via `rt_driver.active.utils.get_device_properties()`. This requires a live GPU driver, but Triton CC compiles kernels on RE (remote execution) where no GPU is available, causing `RuntimeError: 0 active drivers`.

In addition to D96671173, this diff tries querying the GPU driver first and falls back to a static lookup table when no driver is available. The fallback values are `CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` per the CUDA Programming Guide.

Reviewed By: njriasan

Differential Revision: D97003359
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Mar 18, 2026

@Sibylau has exported this pull request. If you are a Meta employee, you can view the originating Diff in D97003359.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 18, 2026
@Sibylau Sibylau requested review from manman-ren and njriasan March 18, 2026 03:51
Copy link
Copy Markdown
Contributor

@manman-ren manman-ren left a comment

Choose a reason for hiding this comment

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

Thanks!

@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync bot commented Mar 18, 2026

@Sibylau has imported this pull request. If you are a Meta employee, you can view this in D97003359.

meta-codesync bot pushed a commit that referenced this pull request Mar 18, 2026
Summary:
D95898963 added `smem_budget` as a parameter to `add_hopper_warpspec`, querying it via `rt_driver.active.utils.get_device_properties()`. This requires a live GPU driver, but Triton CC compiles kernels on RE (remote execution) where no GPU is available, causing `RuntimeError: 0 active drivers`.

In addition to D96671173, this diff tries querying the GPU driver first and falls back to a static lookup table when no driver is available. The fallback values are `CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` per the CUDA Programming Guide.

Differential Revision: D97003359

Pulled By: Sibylau

fbshipit-source-id: a53c72998dafadf58e9919ee7cfb2983a57a4904
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. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants