Skip to content

Password Memorization

examples/server/password_memorization/ — End-to-end test for the full training → weight sync → inference pipeline. Trains a model to memorize 3 secret project codes via SFT, syncs weights to a running xorl-sglang instance, and queries inference to verify recall.

Run:

Terminal window
# 1. Start training server
CUDA_VISIBLE_DEVICES=0,1,2,3 python -m xorl.server.launcher \
--mode auto \
--config examples/server/configs/full/qwen3_8b_full.yaml \
--api-port 6000
# 2. Start xorl-sglang inference (in another terminal)
CUDA_VISIBLE_DEVICES=4 python -m sglang.launch_server \
--model-path Qwen/Qwen3-8B-FP8 --port 30000
# 3. Run the test (in another terminal)
python examples/server/password_memorization/run_password_test.py \
--model Qwen/Qwen3-8B --steps 16 --lr 1e-5

Options:

FlagDefaultDescription
--model(required)HuggingFace model name
--steps64Total training steps
--lr1e-4Peak learning rate
--lr-scheduleconstantconstant, cosine, or warmup_cosine
--sync-quantfp8Sync quantization: fp8 or none
--train-urlhttp://localhost:6000Training server URL
--infer-urlhttp://localhost:30000Inference endpoint URL
Training modeSync path
Full-weight bf16bf16 → fp8 requant → SGLang
LoRAbf16 base + LoRA merged → fp8 requant → SGLang
QLoRA nvfp4nvfp4 dequant → bf16 merged → fp8 requant → SGLang
QLoRA block_fp8fp8 dequant → bf16 merged → fp8 requant → SGLang
QLoRA nf4nf4 dequant → bf16 merged → fp8 requant → SGLang

Qwen3-8B (4x H100):

ModeStepsLRScheduleResult
Full-weight bf16161e-5constant3/3
LoRA rank 32321e-4constant3/3
QLoRA nvfp4645e-5cosine3/3
QLoRA block_fp8645e-4constant3/3

Qwen3-Coder-30B-A3B (4-8x H100):

ModeParallelismStepsLRScheduleResult
Full-weight bf16SP=4, shard=2321e-5constant3/3
LoRA rank 32SP=4321e-4constant3/3
QLoRA nvfp4EP=4, SP=41285e-4cosine3/3

Qwen3-235B-A22B (8x H100, cross-node inference):

ModeParallelismStepsLRScheduleResult
QLoRA nvfp4EP=8, SP=81285e-4cosine3/3
QLoRA nf4EP=8, SP=81285e-4cosine3/3

See the example README for the full test matrix and detailed setup instructions.