_dummy_run fills the positions buffer with arange(num_tokens_padded). A
dummy batch can hold more tokens than one sequence may
(max_num_batched_tokens > max_model_len), so models with a fixed learned
position table index past it: facebook/opt-125m (2050 entries,
max_model_len 1024) trips a device-side "index out of bounds" assert in
profile_run and the engine never starts. Wrap the positions modulo
max_model_len so they stay ascending and in range.
Also let test_serialize_and_serve_entrypoints serve on a free port; it
used the default 8000 and failed wherever that port is taken.
Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Peuqui <peuqui@github.com>