Skip to content

[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
pr/simplify-passes
Mar 16, 2026
Merged

[Prune] Remove fly-gpu-to-llvm pass in favor of upstream gpu-to-llvm, use async_dependency to track stream argument#216
sjfeng1999 merged 1 commit intomainfrom
pr/simplify-passes

Conversation

@sjfeng1999
Copy link
Contributor

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

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
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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-llvm pass registration/build targets/C API exports and delete the pass implementation.
  • Update Python kernel launch emission to pass the stream through gpu.launch_func via async_dependencies.
  • Switch the JIT pipeline fragment from fly-gpu-to-llvm{...} to gpu-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-llvm pass and deletes its dedicated FileCheck coverage, but there is no replacement test to ensure the upstream gpu-to-llvm continues to (a) propagate the stream argument via async_dependencies and (b) avoids creating/destroying streams when a stream is provided. Consider adding a new tests/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.

Copy link
Collaborator

@coderfeli coderfeli left a comment

Choose a reason for hiding this comment

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

Looks good. + @jli-melchior

@jli-melchior
Copy link
Contributor

LGTM

@sjfeng1999 sjfeng1999 merged commit 36dd3fe into main Mar 16, 2026
12 checks passed
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
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)
@sjfeng1999 sjfeng1999 deleted the pr/simplify-passes branch March 17, 2026 03:46
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.

4 participants