Skip to content

feat: OpenAI-compatible server with seed perturbation routes - #14

Open
yuval-peleg-levy-ai21 wants to merge 2 commits into
sunrainyg:mainfrom
yuval-peleg-levy-ai21:randopt-server
Open

yuval-peleg-levy-ai21 wants to merge 2 commits into
sunrainyg:mainfrom
yuval-peleg-levy-ai21:randopt-server

Conversation

@yuval-peleg-levy-ai21

Copy link
Copy Markdown
  • Fix base model test evaluation.
  • Allow equal sign for countdown
  • Add a toy analysis
  • Update title in README
  • Add OLMo3 results to random-step vs. gradient-step experiment
  • update countdown reward functions for baselines
  • Update README.md && Add iterative randopt
  • adding results for random search
  • fix: FP8-safe seeded perturbation and vLLM compat in worker extension
  • feat: OpenAI-compatible server with seed perturbation routes

Seeded noise is now always generated in float32 and added via
p.data.copy_(p.data.float() + delta), so perturbation works on
Float8_e4m3fn weights (no randn/add kernels for FP8), keeps the
parameter storage that NCCL broadcast and CUDA graphs point at, and
stops rounding the noise to bf16 before scaling.

Quantization scale parameters (weight_scale, scale_inv, input_scale,
act_scale, .scale) are skipped by default; PERTURB_SCALES=1 restores
the old behaviour. Vision-encoder weights of VL models are skipped
unless PERTURB_VISUAL=1.

get_ip moved to vllm.utils.network_utils in recent vLLM; import it
with a fallback. utils/ becomes a regular package so spawn-mode
workers can import the extension class by dotted path.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
randopt_server.py wraps vLLM's OpenAI API server and adds /perturb,
/restore, /store_base and /reset, each fanned out to every TP rank
through collective_rpc on utils.worker_extn.WorkerExtension. External
evaluators (agent loops, tool-calling harnesses) can then switch the
served weights between seeds through plain HTTP without restarting
vLLM or going through Ray.

utils/ is copied next to the vllm package at startup because recent
vLLM spawns engine and worker processes with a filtered environment
that drops the launcher's sys.path and PYTHONPATH.

scripts/test_perturb_restore.py is a smoke test that exercises both
undo paths against a live server. README documents the routes and
recommends /store_base + /reset for bf16 and FP8 weights, where the
additive /restore is exact only up to rounding.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant