Repository navigation
fix offload_try_wait - #415
Conversation
Cherry-pick from PR NVIDIA#415 (liuyl_fix_try_wait): - Return READY when no remaining task IDs in offload_kvcache_wait - Treat missing try_wait responses as UNREADY - Only blocking-wait pending tasks in finish_task - Use HTTPS FlexKV submodule URL
|
/build |
Greptile SummaryThis PR fixes two bugs in the FlexKV offload wait logic and makes a submodule/Docker housekeeping update. The core fixes ensure
Confidence Score: 4/5Safe to merge with minor risk: the try_wait polling fix is clearly correct, but finish_task's guard against re-waiting on completed tasks only exempts SUCCESS, potentially leaving FAILED/CANCELLED task IDs exposed to the same NOTFOUND error the PR is fixing. The finish_task change guards against NOTFOUND errors by skipping tasks with a cached SUCCESS response, but FAILED and CANCELLED are also terminal states that FlexKV may release. If FlexKV releases resources on any terminal outcome, calling wait() on a previously-FAILED/CANCELLED task ID will reproduce the exact error being fixed here. corelib/recsys_kvcache_manager/recsys_kvcache_manager/flex_kvcache_manager.py — specifically the pending_task_ids filter in finish_task Important Files Changed
Sequence DiagramsequenceDiagram
participant Caller
participant offload_kvcache_wait
participant FlexKV Client
participant handle.responses
Caller->>offload_kvcache_wait: poll(task_handle)
offload_kvcache_wait->>handle.responses: compute remain_task_ids (exclude known)
alt remain_task_ids is empty
offload_kvcache_wait-->>Caller: READY (early return)
else remain_task_ids non-empty
offload_kvcache_wait->>FlexKV Client: try_wait(remain_task_ids) [non-blocking]
FlexKV Client-->>offload_kvcache_wait: partial/full responses dict
offload_kvcache_wait->>offload_kvcache_wait: "missing IDs → has_unready=True (not stored)"
offload_kvcache_wait->>handle.responses: store returned responses
alt any FAILED or CANCELLED
offload_kvcache_wait-->>Caller: FAILED / CANCELLED
else any UNREADY or missing
offload_kvcache_wait-->>Caller: LAUNCHED (not ready)
else all SUCCESS
offload_kvcache_wait-->>Caller: READY
end
end
Caller->>offload_kvcache_wait: finish_task(task_handle)
offload_kvcache_wait->>handle.responses: "filter pending (status != SUCCESS)"
alt pending_task_ids non-empty
offload_kvcache_wait->>FlexKV Client: wait(pending_task_ids, completely=True) [blocking]
FlexKV Client-->>offload_kvcache_wait: done
end
offload_kvcache_wait-->>Caller: [1, 1, ..., 1]
Reviews (4): Last reviewed commit: "fix ci" | Re-trigger Greptile |
|
❌ Pipeline #54135999 -- failed
Result: 9/14 jobs passed |
|
/build |
|
❌ Pipeline #54156290 -- failed
Result: 10/14 jobs passed |
|
/build |
|
❌ Pipeline #54276811 -- failed
Result: 0/14 jobs passed |
|
/build |
1 similar comment
|
/build |
|
…wait path Fix black formatting in offload_kvcache_wait, drop commented debug prints, and simplify finish_task to use handle.responses directly.
716a700 to
46918b1
Compare
|
/build |
|
❌ Pipeline #54514879 -- failed
Result: 7/14 jobs passed |
|
/build |
|
❌ Pipeline #54532880 -- failed
Result: 10/14 jobs passed |
Description
This PR commit fix try_wait logic.
Changes:
offload_kvcache_wait/try_waithandlingREADYimmediately when there are no remaining task IDs.try_waitresponses asUNREADYinstead of failing the wait logic.try_waitresults.finish_taskhandlingwait()on task IDs that are not yetSUCCESSinhandle.responses.NOTFOUNDerrors when tasks were already completed and released during earliertry_waitpolling.third_party/FlexKVin.gitmodulesfrom SSH to HTTPS for easier clone/CI setup.Checklist