← Back to DAGDA | Support | Source: https://github.com/vllm-project/vllm/pull/67643
Skip to content

[Bugfix][Compilation] Remove AllReduceFusionPass.__del__ destroying the shared FlashInfer workspace - #67643

Open
shadowmodder wants to merge 5 commits into
vllm-project:mainfrom
shadowmodder:shadowmodder/fix/allreduce-pass-del-workspace
Open

shadowmodder wants to merge 5 commits into
vllm-project:mainfrom
shadowmodder:shadowmodder/fix/allreduce-pass-del-workspace

Conversation

@shadowmodder

@shadowmodder shadowmodder commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Purpose

Fix #67629. AllReduceFusionPass.del called destroy_fi_ar_workspace() when a pass instance was garbage-collected, destroying the process-global FlashInfer all-reduce workspace while compiled callables, CUDA graphs, and communicators may still use it. The workspace lifetime is already owned by the process and the communicator. destroy_fi_ar_workspace is atexit-registered in flashinfer_all_reduce.py and called on communicator shutdown. This PR removes the pass-level del, the destroy_fi_ar_workspace import that only it used, and the contextlib import that only it used, and adds a regression test pinning that the pass does not own the workspace.

This does not duplicate an existing PR. Before opening it, I checked the API search and the live open-PR list for 67629, destroy_fi_ar_workspace, and AllReduceFusionPass. No open PR references the issue or touches this del.

Test Plan

  • Regression test test_allreduce_fusion_pass_does_not_own_global_workspace in tests/compile/passes/distributed/test_fusion_all_reduce.py, behavioral: it intercepts destroy_fi_ar_workspace at the fusion module and at its definition site, drops a live pass instance (disabled=False), forces gc.collect(), and asserts the destroy was never called. It also asserts the class defines no del.
  • Mutation check on the test logic: run against a faithful stub of the pre-fix class, the destroy mock records a call on garbage collection, so the test fails; against the fixed shape it records none, so the test passes.
  • The targeted pytest file could not be collected in my sandbox. Collection fails importing vllm._C (a _OpNamespace rotary_embedding AttributeError), reproduced identically on the unmodified main checkout, so the full test run is left to CI.

Test Results

  • Behavioral mutation check on the test logic: pre-fix shape calls destroy on garbage collection (test fails), fixed shape does not (test passes).
  • No model-eval impact. The change only removes a destructor for a shared workspace. It changes no computed tensor, kernel, or fusion pattern.

AI assistance: this change was prepared with AI assistance and reviewed by the author before submission.

…rkspace

The FlashInfer all-reduce workspace is process-global. destroy_fi_ar_workspace is atexit-registered and called on communicator shutdown, so its lifetime is already owned by the process, not by a pass instance. Fixes the root cause of vllm-project#67629.

Signed-off-by: shadowmodder <sudhirvissa@gmail.com>

Signed-off-by: Sudhir Vissa <sudhirvissa@gmail.com>
Signed-off-by: shadowmodder <sudhirvissa@gmail.com>

Signed-off-by: Sudhir Vissa <sudhirvissa@gmail.com>
Signed-off-by: shadowmodder <sudhirvissa@gmail.com>

Signed-off-by: Sudhir Vissa <sudhirvissa@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Signed-off-by: shadowmodder <sudhirvissa@gmail.com>

Signed-off-by: Sudhir Vissa <sudhirvissa@gmail.com>
Signed-off-by: shadowmodder <sudhirvissa@gmail.com>

Signed-off-by: Sudhir Vissa <sudhirvissa@gmail.com>

This branch has not been deployed

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

Labels

bug Something isn't working torch.compile

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

[Bug]: AllReduceFusionPass.__del__ destroys process-global FlashInfer all-reduce workspace while CUDA graphs / communicators still use it

1 participant