Skip to content

[S-TIR][Dlight] Add layered fall back strategy to handle missing attr max_shared_memory_per_block#19453

Merged
mshr-h merged 5 commits into
apache:mainfrom
cchung100m:issue-19419
Apr 29, 2026
Merged

[S-TIR][Dlight] Add layered fall back strategy to handle missing attr max_shared_memory_per_block#19453
mshr-h merged 5 commits into
apache:mainfrom
cchung100m:issue-19419

Conversation

@cchung100m

Copy link
Copy Markdown
Contributor

Hi Committers,

This PR is trying to fix issues #19419. Any suggestions would be appreciated if you are available.

Root Cause

  • auto-detected CUDA might lacks max_shared_memory_per_block and it would cause KeyError

Solutions

  • Add layered fall back strategy to handle missing attr max_shared_memory_per_block

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a robust fallback mechanism for determining the maximum shared memory per block across various GPU targets. It adds the get_max_shared_memory_per_block utility function in common_analysis.py, which provides default values for CUDA, ROCm, Metal, OpenCL, and Vulkan when the target attribute is not explicitly defined. The gemv and low_batch_gemv schedules were updated to utilize this new function. Feedback suggests moving the hardcoded mapping dictionary to a module-level constant to optimize performance and improve code structure.

Comment thread python/tvm/s_tir/dlight/analysis/common_analysis.py Outdated
@cchung100m cchung100m marked this pull request as ready for review April 27, 2026 15:59
@cchung100m

Copy link
Copy Markdown
Contributor Author

Hi @tlopex @mshr-h

This PR is trying to fix issues #19419. Any suggestions would be appreciated if you are available. 😄

Comment thread python/tvm/s_tir/dlight/analysis/common_analysis.py Outdated
@cchung100m cchung100m marked this pull request as draft April 28, 2026 13:40
@cchung100m cchung100m marked this pull request as ready for review April 28, 2026 15:02
@mshr-h mshr-h merged commit 7ecf466 into apache:main Apr 29, 2026
11 checks passed
@cchung100m cchung100m deleted the issue-19419 branch April 29, 2026 15:46
@cchung100m

Copy link
Copy Markdown
Contributor Author

Thanks to @mshr-h 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants