[Prune] Remove fly-gpu-to-llvm pass in favor of upstream gpu-to-llvm, use async_dependency to track stream argument#216
Merged
sjfeng1999 merged 1 commit intomainfrom Mar 16, 2026
Conversation
Now that async_dependencies is used to track the stream parameter, the upstream gpu-to-llvm pass correctly handles stream propagation. The custom fly-gpu-to-llvm hack is no longer needed. Made-with: Cursor
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the project-specific fly-gpu-to-llvm conversion pass and switches the Python JIT compilation pipeline to rely on upstream MLIR gpu-to-llvm, with stream propagation now modeled via async_dependencies.
Changes:
- Drop
fly-gpu-to-llvmpass registration/build targets/C API exports and delete the pass implementation. - Update Python kernel launch emission to pass the stream through
gpu.launch_funcviaasync_dependencies. - Switch the JIT pipeline fragment from
fly-gpu-to-llvm{...}togpu-to-llvm{...}and remove the corresponding MLIR conversion test + docs reference.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/fly-opt/fly-opt.cpp | Stops registering the removed fly-gpu-to-llvm pass. |
| tools/fly-opt/CMakeLists.txt | Removes linkage to MLIRFlyGpuToLLVM. |
| tests/mlir/Conversion/fly_gpu_to_llvm.mlir | Deletes FileCheck coverage for the removed custom pass. |
| python/mlir_flydsl/FlyRegisterEverything.cpp | Stops registering the removed pass in Python bindings. |
| python/flydsl/compiler/kernel_function.py | Emits gpu.launch_func with async_dependencies derived from the stream. |
| python/flydsl/compiler/jit_function.py | Uses upstream gpu-to-llvm in the pipeline and includes formatting-only edits. |
| lib/Conversion/FlyGpuToLLVM/FlyGpuToLLVM.cpp | Removes the custom pass implementation. |
| lib/Conversion/FlyGpuToLLVM/CMakeLists.txt | Removes the conversion library target. |
| lib/Conversion/CMakeLists.txt | Stops building the removed conversion subdirectory. |
| lib/CAPI/Dialect/FlyROCDL/FlyROCDLDialect.cpp | Removes C API registration wrapper for the removed pass. |
| lib/CAPI/Dialect/FlyROCDL/CMakeLists.txt | Removes linkage to MLIRFlyGpuToLLVM. |
| include/flydsl/Conversion/Passes.td | Removes ODS pass definition for fly-gpu-to-llvm. |
| include/flydsl/Conversion/Passes.h | Drops include of the removed pass header. |
| include/flydsl/Conversion/FlyGpuToLLVM/FlyGpuToLLVM.h | Removes the public header for the deleted pass. |
| include/flydsl-c/FlyROCDLDialect.h | Removes the exported C API declaration for registering the deleted pass. |
| docs/testing_benchmarking_guide.md | Removes the deleted test from the documentation table. |
Comments suppressed due to low confidence (1)
python/flydsl/compiler/jit_function.py:312
- The PR removes the custom
fly-gpu-to-llvmpass and deletes its dedicated FileCheck coverage, but there is no replacement test to ensure the upstreamgpu-to-llvmcontinues to (a) propagate the stream argument viaasync_dependenciesand (b) avoids creating/destroying streams when a stream is provided. Consider adding a newtests/mlir/Conversion/*test that runs--gpu-to-llvm(or the full pipeline fragment used here) and checks the resulting LLVM lowering to guard against regressions when MLIR is updated.
f"rocdl-attach-target{{O=2 abi=600 chip={chip} correct-sqrt=true daz=false fast=false features= "
f"finite-only=false module= triple=amdgcn-amd-amdhsa unsafe-math=false wave64=true}}",
"convert-scf-to-cf",
"convert-cf-to-llvm",
"gpu-to-llvm{use-bare-pointers-for-host=true use-bare-pointers-for-kernels=true}",
"convert-arith-to-llvm",
"convert-func-to-llvm",
"reconcile-unrealized-casts",
"gpu-module-to-binary{format=fatbin}",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
coderfeli
approved these changes
Mar 16, 2026
Collaborator
coderfeli
left a comment
There was a problem hiding this comment.
Looks good. + @jli-melchior
Contributor
|
LGTM |
jli-melchior
added a commit
that referenced
this pull request
Mar 16, 2026
Add IR-level and end-to-end tests for GPU stream handling after the gpu-to-llvm migration (#216): - test_async_object_vs_deps: Verifies upstream gpu-to-llvm behavior — asyncObject silently dropped, asyncDependencies type constraints, async token chain lifecycle (mgpuStreamCreate/Destroy). - test_multi_stream_launch: Multi-kernel multi-stream patterns — independent streams, same-stream ordering, graph capture, diamond fork-join with event sync, and race condition without sync. Made-with: Cursor
1 task
coderfeli
pushed a commit
that referenced
this pull request
Mar 17, 2026
Add IR-level and end-to-end tests for GPU stream handling after the gpu-to-llvm migration (#216)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now that async_dependencies is used to track the stream parameter, the upstream gpu-to-llvm pass correctly handles stream propagation. The custom fly-gpu-to-llvm hack is no longer needed.
Made-with: Cursor
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist