Skip to content

Load Triton only when the CUDA profiler marker is used - #27

Open
huangxinV587 wants to merge 1 commit into
deepseek-ai:mainfrom
huangxinV587:fix/lazy-triton-profiler-import
Open

huangxinV587 wants to merge 1 commit into
deepseek-ai:mainfrom
huangxinV587:fix/lazy-triton-profiler-import

Conversation

@huangxinV587

Copy link
Copy Markdown

Importing tests.kernelkit eagerly imports Triton and constructs a CUDA profiler marker, preventing packaging/correctness helpers from importing in an Ascend environment without Triton.

Create the marker on first use and cache the JIT object. CUDA marker calls still require Triton and launch the same one-program kernel; repeated calls reuse the marker.

Validation: three subprocess tests passed using real CPU PyTorch and explicit Triton import rejection: package import without Triton, an explicit missing dependency when the CUDA marker is invoked, and one JIT construction with two marker launches using a fixture. Before the fix, the two missing-dependency cases failed. CUDA profiling and NPU kernels were not run.

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.

1 participant