[https://nvbugs/6480574][fix] seed attrs bypassed by __new__ in pool session shutdown test#16630
Conversation
📝 WalkthroughWalkthroughThe shutdown test now initializes ChangesProxy fast-death test coverage
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/bot run --disable-fail-fast |
|
PR_Github #60529 [ run ] triggered by Bot. Commit: |
|
PR_Github #60529 [ run ] completed with state
|
|
/bot run |
|
PR_Github #60581 [ run ] triggered by Bot. Commit: |
|
PR_Github #60581 [ run ] completed with state
|
…session shutdown test test_pool_session_shutdown_never_blocks_after_release constructs a MpiPoolSession with __new__() and only sets mpi_pool, then calls release_exit_joins() and shutdown(). MpiPoolSession.shutdown() reads self.n_workers (log line) and self._wait_shutdown (post-shutdown worker barrier); on the raw-constructed session both are absent and the second attribute access raises AttributeError before the code under test runs. Seed the two attributes on the mock session so the test exercises the release/shutdown contract instead of failing on attribute lookup. Keep _wait_shutdown=False because the test targets the blocking-join guard, not the identity-based worker-exit wait. Signed-off-by: JunyiXu-nv <219237550+JunyiXu-nv@users.noreply.github.com>
…ver_blocks_after_release The test now seeds the attributes that MpiPoolSession.shutdown() reads, so the AttributeError raised on the raw-constructed session is gone and the test passes. Remove the waive. Signed-off-by: JunyiXu-nv <219237550+JunyiXu-nv@users.noreply.github.com>
0a09355 to
1571acd
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #60678 [ run ] triggered by Bot. Commit: |
|
PR_Github #60678 [ run ] completed with state |
BowenFu
left a comment
There was a problem hiding this comment.
LGTM — test-only. Seeds n_workers/_wait_shutdown on the new-built MpiPoolSession (mirroring init defaults) so shutdown()'s wait=False path is correctly exercised, and un-waives the case. No production code touched, copyright header current, CI green — a valid regression guard for nvbugs/6480574.
…ool-session test test_proxy_fast_death builds GenerationExecutorProxy / MpiPoolSession via __new__ (bypassing __init__), then drives shutdown(). A recent main change (NVIDIA#16523, multi-process HTTP frontends) made GenerationExecutorProxy.shutdown() -> _cleanup_multi_frontend_ipc_dir() read self._multi_frontend_ipc_dir unguarded, so the __new__-built proxies raise AttributeError at GC/teardown (test_shutdown_does_not_block_on_dead_engine and the two sibling shutdown tests). This is a cross-PR merge-skew: NVIDIA#16312 added the __new__-based tests, NVIDIA#16523 later added the unguarded attribute access; neither PR tested the combination. Seed _multi_frontend_ipc_dir / _multi_frontend_hmac in the shared _bare_proxy() helper so the teardown path is a clean no-op, mirroring how NVIDIA#16630 (nvbugs/6480574) handled the earlier n_workers/_wait_shutdown variant. Also re-align with main: restore the n_workers/_wait_shutdown seeding in test_pool_session_shutdown_never_blocks_after_release and drop its now-removed waive (main dropped it in NVIDIA#16630). Whole file: 23 passed (was 3 failed + 1 waived/broken). Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
…roxy_fast_death __new__ seeding Two base-branch (main) regressions surfaced by rebasing onto latest main; neither is in the KVCacheManagerV2 change set. 1) tensorrt_llm import break (nvbugs/6442074): SpecWorkerBase.__init_subclass__ forbids subclasses from overriding forward() -- they must implement _forward_impl so the base forward() wrapper can guarantee spec-dec attn-metadata cleanup. MTPEagleDynamicTreeWorker still overrode forward(), so 'import tensorrt_llm' raised TypeError at class-definition time via the normal _torch.models -> speculative -> mtp_dynamic_tree import chain, breaking all test collection / package sanity. Rename its forward() to _forward_impl(), matching every sibling worker (MTPEagleWorker, DSparkWorker, eagle3, eagle3_dynamic_tree); callers use the base forward() wrapper so no caller changes. Verified: 'import tensorrt_llm' succeeds again. 2) test_proxy_fast_death cross-PR merge-skew: NVIDIA#16312 added __new__-built proxy tests; NVIDIA#16523 later made GenerationExecutorProxy.shutdown() -> _cleanup_multi_frontend_ipc_dir() read self._multi_frontend_ipc_dir unguarded, so the __new__ proxies raised AttributeError at teardown. Seed _multi_frontend_ipc_dir/_multi_frontend_hmac in the shared _bare_proxy() helper so GC-time teardown is a clean no-op, mirroring NVIDIA#16630 (nvbugs/6480574) for the earlier n_workers variant. Signed-off-by: Yao Yao <lowsfer@users.noreply.github.com>
…new__ proxy mock (drop after upstream fix) NVIDIA#16523 added _multi_frontend_ipc_dir (set in __init__) and shutdown() now always calls _cleanup_multi_frontend_ipc_dir(), including the workers_started=False early path. test_proxy_fast_death.py builds proxies via GenerationExecutorProxy.__new__ without __init__, so every shutdown() (and the __del__ GC path) raises AttributeError on main. Seed the attr in _bare_proxy(), same pattern as NVIDIA#16630. Temporary carry so this PR's CI can go green; becomes a no-op once the equivalent fix lands on main. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
…e re-added during rebase (fixed by NVIDIA#16630) Signed-off-by: Chuang Zhu <111838961+chuangz0@users.noreply.github.com>
Summary by CodeRabbit
Description
test_pool_session_shutdown_never_blocks_after_releaseconstructs aMpiPoolSessionwith__new__()and only setsmpi_pool, then callsrelease_exit_joins()andshutdown().MpiPoolSession.shutdown()readsself.n_workers(log line) andself._wait_shutdown(post-shutdown worker barrier); on the raw-constructed session both are absent and the second attribute access raisesAttributeErrorbefore the code under test runs.Seed the two attributes on the mock session so the test exercises the release/shutdown contract instead of failing on attribute lookup. Keep
_wait_shutdown=Falsebecause the test targets the blocking-join guard, not the identity-based worker-exit wait.Test Coverage
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.