megatron_server Mismatched Logprobs Fix
Hao AI Lab fixed an issue in megatron_server where, after a Ray worker crashed and restarted, subsequent batches were mismatched with old requests, returning incorrect teacher logprobs. A worker run ID and batch ID mechanism can now immediately flag lost batches; previously, in each of three reproduction runs, six to seven out of ten HTTP 200 responses were mismatched, while after the fix, all three runs had zero mismatches.
Body
(2/8) Silent wrong teacher logprobs: after one worker crashes and restarts in megatron_server, later requests receive another request's logprobs with HTTP 200.
In megatron_server, a Ray worker pulls batches from SampleManager, computes logprobs on GPUs, and sends them back. Meanwhile, SampleManager tracks waiting requests in a FIFO queue, assuming results return in order. When that worker crashes, Ray restarts it fresh and drops the running batches. However, those lost requests stay at the front of the queue. As a result, every later batch matches an older request, sending wrong logprobs to clients while newer requests hang.
Reproduction: Killing the worker once while 2 batches were running made every reply after restart (6 to 7 out of 10 HTTP 200 responses) carry another request's logprobs across 3 runs.
Our fix: We give each worker run its own ID, so SampleManager fails lost batches right away and matches replies by batch ID. With this fix, all 3 runs had zero mismatches.
PR: https://t.co/XZjLyun1oM
AI Trends