Skip to content

scripts: add engine definition smoke test against a deployed control plane - #63

Merged
micahtyong merged 5 commits into
mainfrom
devin/1790189408-lora-smoke
Sep 23, 2026
Merged

micahtyong merged 5 commits into
mainfrom
devin/1790189408-lora-smoke

Conversation

@micahtyong

@micahtyong micahtyong commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

scripts/e2e_engine_definition.py is the deep per-definition E2E: it spins up its own ephemeral app, refuses CATALOG_VISIBLE = False definitions and expects FFT-style constants the Miles LoRA definitions don't have. There was no quick way to check that a freshly redeployed shared lilo actually serves a given definition end to end.

scripts/definition_smoke.py is that check. It runs against an existing control plane (TINKER_BASE_URL / TINKER_API_KEY) and accepts any id from lilo.providers.modal.definitions; default is qwen3_8_27b_miles_lora_64k.

definition = module_for(id)
full : create_full_training_client(service, id)
lora : create_lora_training_client(base_model=id, rank=min(16, MAX_LORA_RANK),
                                   train_attn/mlp/unembed = lora_target_flags(TARGET_MODULES))
forward_backward(cross_entropy) + optim_step
save_weights_and_get_sampling_client() -> sample
forward_backward(importance_sampling on the sample) + optim_step
save_weights_and_get_sampling_client() -> sample
POST /api/v1/unload_model                      # release the trainer / slot

The definition id is passed as base_model, which definition_for in control_plane/http.py matches explicitly, so non-cataloged definitions (27B 64k/128k/256k) are reachable. --definition-id is repeatable, --parallel runs them concurrently, --list prints all definitions. Writes a timestamped JSON report to scripts/results/ (gitignored) and exits non-zero if any definition fails.

Two things learned from live runs that Tinker clients hitting Miles LoRA definitions need to know:

  • Miles fixes LoRA targets per deployment, so the model's train_attn/train_mlp/train_unembed must equal what TARGET_MODULES implies ((True, True, False) for the current definitions). The Tinker SDK default train_unembed=True is rejected — and only after the trainer cold-starts. The leaf→flag mapping is extracted from MilesCommandBackend._validate_job into miles_config.lora_target_flags() so the script and backend can't drift.
  • importance_sampling datums must have target_tokens == model_input[1:] + [next] over the whole sequence (prompt positions included, with zero advantages); miles_runtime.data validates the shift strictly.
export TINKER_BASE_URL=... TINKER_API_KEY=...
uv run scripts/definition_smoke.py                                   # 27B/64k
uv run scripts/definition_smoke.py --parallel \
    --definition-id qwen3_5_9b_miles_lora_16k --definition-id qwen3_5_4b_full_64k

Verified live against lilo in lilo-deploy at 784dc95: qwen3_5_9b_miles_lora_16k (449s) and qwen3_8_27b_miles_lora_64k (698s) pass all phases.

Link to Devin session: https://modal.devinenterprise.com/sessions/6463b80692584829b19bba8d9bd1d11d
Open in Devin Desktop: https://modal.devinenterprise.com/desktop/session/6463b80692584829b19bba8d9bd1d11d?variant=devin
Requested by: @micahtyong

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'DevinAI' or '@devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

micahtyong and others added 3 commits September 23, 2026 19:34
…ployment targets

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…lora_64k

Rename lora_smoke.py to definition_smoke.py. The client type (full vs LoRA)
and LoRA train_attn/train_mlp/train_unembed flags now come from the definition
module via lora_target_flags(), which miles_lora._validate_job also uses, so
the request always matches the deployment's target modules. Adds --list.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title scripts: add LoRA definition smoke test against a deployed control plane scripts: add engine definition smoke test against a deployed control plane Sep 23, 2026
@micahtyong

Copy link
Copy Markdown
Contributor Author

/devin review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Starting Devin Review.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

/devin review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 4 potential issues.

Devin Review

Comment thread scripts/definition_smoke.py
Comment thread scripts/definition_smoke.py Outdated
Comment thread scripts/definition_smoke.py Outdated
Comment thread scripts/definition_smoke.py Outdated
…uence fwd/optim

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@micahtyong
micahtyong merged commit ca528ed into main Sep 23, 2026
2 checks passed
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