freesolo-flash-dev 0.2.58__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/PKG-INFO +1 -1
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cost/analytical.py +58 -12
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/loader.py +1 -1
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/serve/deploy.py +50 -11
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/pyproject.toml +2 -2
- freesolo_flash_dev-1.0.0/tests/test_accounting_coverage.py +76 -0
- freesolo_flash_dev-1.0.0/tests/test_cli_commands_coverage.py +213 -0
- freesolo_flash_dev-1.0.0/tests/test_cli_main_coverage.py +19 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_cache_evict.py +10 -2
- freesolo_flash_dev-1.0.0/tests/test_env_pull_coverage.py +175 -0
- freesolo_flash_dev-1.0.0/tests/test_lora_rank_coverage.py +163 -0
- freesolo_flash_dev-1.0.0/tests/test_packing_coverage.py +149 -0
- freesolo_flash_dev-1.0.0/tests/test_provider_preflight_coverage.py +61 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_serve.py +118 -3
- freesolo_flash_dev-1.0.0/tests/test_server_app_coverage.py +192 -0
- freesolo_flash_dev-1.0.0/tests/test_server_checkpoints_coverage.py +77 -0
- freesolo_flash_dev-1.0.0/tests/test_server_locks_coverage.py +55 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_serving_contract.py +131 -6
- freesolo_flash_dev-1.0.0/tests/test_serving_pricing_coverage.py +21 -0
- freesolo_flash_dev-1.0.0/tests/test_serving_schema_coverage.py +203 -0
- freesolo_flash_dev-1.0.0/tests/test_vast_provider_coverage.py +131 -0
- freesolo_flash_dev-1.0.0/tests/test_wandb_log_coverage.py +109 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/uv.lock +1 -1
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.claude/skills/verify/SKILL.md +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.dockerignore +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.env.example +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/auto-rebake.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/bake-kernel-cache.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/ci.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/main-source-guard.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/notify-tests-repo.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/publish-dev.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/publish-image.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/publish.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/version-parity.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.github/workflows/worker-image.yml +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/.gitignore +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/Dockerfile +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/Dockerfile.worker +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/LICENSE +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/README.md +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/build/kernel_cache/.gitignore +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/build/kernel_cache/.keep +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/docker/Dockerfile.kernelcache +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/docker/Dockerfile.kernelcache.relayer +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/docker/bake_kernel_cache.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/docker/bake_pod_entry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/docker/kernel_fingerprint.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/docker/make_rp_handler.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/_channel.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/_fileio.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/_logging.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/_update_check.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/adapter_artifacts.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/catalog.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/__main__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/_tty.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/commands.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/env_setup.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/envpush.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/render.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cli/training_doc.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/client/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/client/config.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/client/http.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/client/runtime_secrets.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/client/specs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cost/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cost/facts.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cost/spec.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/cost/types.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/diagnostics.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/accounting.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/chalk_kernels.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/multiturn_rollout.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/recipe.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/steps.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/structured_outputs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/vram.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/__main__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/_pkg.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/adapter.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/decoding.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/finalize.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/gpu_setup.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/grpo.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/heartbeat.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/hf.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/kernel_warmup.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/lora.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/opd.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/opd_gkd.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/opd_vllm.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/packing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/attn.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/diagnostics.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/lifecycle.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/liger.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/loraplus.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/perf/memory.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/rl.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/rng.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/sft.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/teacher.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/tokenizer_align.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker/wandb_log.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/engine/worker_entrypoint.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/adapter.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/archive.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/archive_policy.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/base.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/pull.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/envs/registry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/lora_rank.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/opd_retry_contract.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_auth.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_deadline.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_hf_artifacts.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_hf_retry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_http.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_instance.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_instance_bootstrap.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_instance_poll.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_instance_provider.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_poll.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/_worker.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/allocator.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/base.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/api.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/auth.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/gpus.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/jobs/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/jobs/builders.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/lambdalabs/pricing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/realized.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/api.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/auth.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/cost.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/gpus.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/jobs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/keys.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/preload.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/pricing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/slots.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/train/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/runpod/train/endpoints.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/api.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/auth.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/jobs/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/jobs/builders.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/providers/vast/pricing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/py.typed +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/runner/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/runner/checkpoints.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/runner/deploy.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/runner/lifecycle.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/runner/verified_revisions.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/schema/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/schema/fields.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/serve/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/serve/export.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/serve/pricing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/serve/urls.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/__main__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/_deps.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/_internal_client.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/_locks.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/_runtime.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/app.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/auth.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/billing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/billing_retry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/checkpoints.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/db.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/environment_registry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/envs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/reconcile.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/repo_cleanup.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/routes/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/routes/envs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/routes/meta.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/routes/runs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/routes/serving.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/server/run_registry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/flash/spec.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/infisical-entrypoint.sh +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/scripts/build_dev_dist.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/_helpers/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/_helpers/runner.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/_helpers/specs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/_helpers/vast.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/conftest.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/fixtures/math_eval.jsonl +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/fixtures/math_train.jsonl +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/live/__init__.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/live/conftest.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/live/test_lambda_live.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/live/test_runpod_live.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/live/test_vast_live.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_agent_flash_cli_contract.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_algorithms.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_allocator.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_b200_rollout_opt.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_backend_jobspec_contract.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_base_model_provenance.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_billing_retry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cancel_remote.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_catalog_consistency.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_chalk_kernels.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_charge_pricing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_checkpoints.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_commands.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_errors.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_estimate.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_help.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_managed.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_render_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cli_render_theme.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_client.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_client_server_integration.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_config_overrides.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_controlled_experiment_repairs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cost_analytical.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cost_equation.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cost_estimate.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cost_hardware.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cost_models.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_cost_rewards.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_dev_channel.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_disk_gb.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_endpoint_name.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_delete.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_download.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_download_api.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_no_install.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_publish.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_pull.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_pull_loader_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_pull_managed_control_plane.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_push.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_env_rate_limit_resolve.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_envs_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_export.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_flash_mvp.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_flash_worker.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_flashinfer_cache_dirs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_github_urlopen_retry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_gpus.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_grpo_mask_aware.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_grpo_params.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_grpo_sleep_gate.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_health_liveness.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_hf_retry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_idle_endpoint_reaper.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_instance_bootstrap_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_internal_client.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_jobs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_kernel_cache.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_kernel_fingerprint.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_kv_util.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_lambda_api_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_lambda_runner.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_logging.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_login_perms.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_lora_rank_preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_managed_hf_repo.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_metrics_schema_agent_contract.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_mig_guard.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_multiturn_rollout.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_multiturn_rollout_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_multiturn_rollout_records.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_multiturn_rollout_request_policy.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_oom_escalate_gpu.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_opd.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_opd_full_state_resume.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_opd_resume_safety.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_opd_vllm.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_open_model_policy.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_orchestrator_flash.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_packing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_poll_helpers.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_provider_routing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_provider_teardown_robustness.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_providers_symmetry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_realized_cost.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_repo_cleanup.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_resolve_params_b.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_resume_on_retry.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_runmgmt.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_runpod_api_delete.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_runpod_key_fingerprint.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_runpod_key_waterfall.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_runpod_slots.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_server_api.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_server_billing.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_server_db.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_server_envs_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_sft_example_selection.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_sft_gc_off.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_sft_max_context.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_spec_and_validation.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_structured_outputs.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_thinking_config.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_train_context_preflight.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_training_controls.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_update_check.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_vast_api.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_vast_api_coverage.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_vast_offers.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_vast_runner.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_verified_revisions.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_verifiers.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_version.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_vl_warmstart_adapter_keys.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_wandb_naming.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_warmstart_cross_repo.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_weight_cache.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_worker_dryrun.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_worker_hardexit.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_worker_image.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_worker_init_heartbeat.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_worker_stack.py +0 -0
- {freesolo_flash_dev-0.2.58 → freesolo_flash_dev-1.0.0}/tests/test_worker_thinking.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: freesolo-flash-dev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Flash — managed LoRA post-training (SFT/GRPO/OPD) for Freesolo environments, driven by the `flash` CLI
|
|
5
5
|
Project-URL: Homepage, https://github.com/freesolo-co/flash
|
|
6
6
|
Project-URL: Repository, https://github.com/freesolo-co/flash
|
|
@@ -40,6 +40,22 @@ MFU_TRAIN = 0.35 # GRPO policy/reference update
|
|
|
40
40
|
MFU_SFT_TRAIN = 0.25 # SFT fwd/bwd (smaller effective batch, long sequences)
|
|
41
41
|
MFU_DECODE = 0.12 # batched vLLM rollout (decode is memory-bandwidth-bound)
|
|
42
42
|
|
|
43
|
+
# --- MoE (mixture-of-experts) per-step correction ----------------------------------------------
|
|
44
|
+
# For an MoE model (active params << total, e.g. Qwen3.6-35B-A3B: ~3B active / 35B total) the wall
|
|
45
|
+
# time per step is NOT the tiny active-param FLOPs the dense model predicts. Routing, all-expert
|
|
46
|
+
# coordination, and grouped-GEMM under-utilization at small batch make the step scale with TOTAL
|
|
47
|
+
# params. Pricing 35B-A3B on active params under-quoted real RunPod runs by 13-27x (SFT ~1.2s vs
|
|
48
|
+
# ~42s realized/step; GRPO ~1.4s vs ~24s). So an MoE prices on TOTAL params at a reduced effective
|
|
49
|
+
# MFU + a per-step overhead + a one-time compile. DENSE models (active == total) are unaffected --
|
|
50
|
+
# they keep the original active-param path and the MFUs above.
|
|
51
|
+
MFU_SFT_TRAIN_MOE = 0.10 # MoE SFT fwd/bwd priced on total params
|
|
52
|
+
MFU_TRAIN_MOE = 0.09 # MoE GRPO/OPD policy update priced on total params
|
|
53
|
+
MOE_STEP_OVERHEAD_S = 2.0 # routing/dispatch/kernel-launch overhead an MoE pays every step
|
|
54
|
+
# One-time kernel/graph compile amortized into the first training step (fused Triton kernels;
|
|
55
|
+
# + vLLM cudagraph capture for rollout methods). MoE-only; the prior model omitted it entirely.
|
|
56
|
+
COMPILE_MOE_SFT_S = 35.0
|
|
57
|
+
COMPILE_MOE_ROLLOUT_S = 48.0 # GRPO / OPD (adds vLLM cudagraph capture)
|
|
58
|
+
|
|
43
59
|
# Reward grading is CONCURRENT: a step's completions score in parallel slots, so the reward
|
|
44
60
|
# wall is ceil(completions / slots) waves x latency, not completions x latency.
|
|
45
61
|
REWARD_CONCURRENCY = 16.0
|
|
@@ -116,13 +132,32 @@ def required_save_overhead_seconds(config: RunConfig) -> float:
|
|
|
116
132
|
return len(n.save_at_steps) * per_save
|
|
117
133
|
|
|
118
134
|
|
|
135
|
+
def _is_moe(model_id: str) -> bool:
|
|
136
|
+
"""True when the model routes each token through a subset of experts (active < total params)."""
|
|
137
|
+
return active_params_b(model_id) < total_params_b(model_id)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def compile_seconds(config: RunConfig, gpu: str) -> float:
|
|
141
|
+
"""One-time kernel/graph compile folded into the first training step. MoE-only; 0 for dense
|
|
142
|
+
(whose original timing did not model it). Larger for rollout methods (add vLLM cudagraph
|
|
143
|
+
capture)."""
|
|
144
|
+
_ = gpu
|
|
145
|
+
if not _is_moe(config.model_id):
|
|
146
|
+
return 0.0
|
|
147
|
+
return COMPILE_MOE_SFT_S if config.method == "sft" else COMPILE_MOE_ROLLOUT_S
|
|
148
|
+
|
|
149
|
+
|
|
119
150
|
def seconds_per_step(config: RunConfig, gpu: str) -> float:
|
|
120
151
|
"""Steady-state wall time for one optimizer step on ``gpu``."""
|
|
121
152
|
n = config.normalized()
|
|
122
|
-
# Per-token FLOPs scale with the ACTIVE params (an MoE token routes through only a subset of
|
|
123
|
-
# experts); for a dense model this equals the total. Memory/size terms below keep total_params_b.
|
|
124
|
-
params = active_params_b(n.model_id) * 1e9
|
|
125
153
|
peak = gpu_tflops(gpu) * 1e12 # FLOP/s
|
|
154
|
+
# An MoE's per-step wall scales with TOTAL params (routing + all-expert coordination + grouped
|
|
155
|
+
# GEMM under-utilization), not the tiny active-param FLOPs; dense models keep active (== total).
|
|
156
|
+
moe = _is_moe(n.model_id)
|
|
157
|
+
params = (total_params_b(n.model_id) if moe else active_params_b(n.model_id)) * 1e9
|
|
158
|
+
overhead = MOE_STEP_OVERHEAD_S if moe else 0.0
|
|
159
|
+
sft_mfu = MFU_SFT_TRAIN_MOE if moe else MFU_SFT_TRAIN
|
|
160
|
+
update_mfu = MFU_TRAIN_MOE if moe else MFU_TRAIN
|
|
126
161
|
|
|
127
162
|
if n.is_opd:
|
|
128
163
|
# OPD step = on-policy student rollout (like GRPO) + remote teacher scoring (CONCURRENT
|
|
@@ -131,7 +166,7 @@ def seconds_per_step(config: RunConfig, gpu: str) -> float:
|
|
|
131
166
|
# sequence (see _opd_step_shape), not completion-only, or long-prompt opd is underquoted.
|
|
132
167
|
completions, seq_tokens = _opd_step_shape(n)
|
|
133
168
|
gen_s = (GRPO_GEN_FLOPS_PER_TOKEN_PER_PARAM * params * seq_tokens) / (peak * MFU_DECODE)
|
|
134
|
-
update_s = (OPD_UPDATE_FLOPS_PER_TOKEN_PER_PARAM * params * seq_tokens) / (peak *
|
|
169
|
+
update_s = (OPD_UPDATE_FLOPS_PER_TOKEN_PER_PARAM * params * seq_tokens) / (peak * update_mfu)
|
|
135
170
|
teacher_lat = teacher_seconds_per_completion()
|
|
136
171
|
# run_opd's primary path scores a step's completions CONCURRENTLY over Fireworks with a fan-out
|
|
137
172
|
# cap of the step's OWN completion count (prompts_per_step * group_size, opd.py Phase 2), so
|
|
@@ -139,30 +174,33 @@ def seconds_per_step(config: RunConfig, gpu: str) -> float:
|
|
|
139
174
|
# latency, NOT the full serial sum (that describes only the CPU-test fallback that can't
|
|
140
175
|
# batch-generate). The teacher endpoint's rate limit is the real ceiling on this fan-out.
|
|
141
176
|
teacher_s = teacher_lat
|
|
142
|
-
return gen_s + teacher_s + update_s
|
|
177
|
+
return overhead + gen_s + teacher_s + update_s
|
|
143
178
|
|
|
144
179
|
if not n.is_grpo:
|
|
145
180
|
flops = SFT_FLOPS_PER_TOKEN_PER_PARAM * params * (n.batch_size * n.seq_len)
|
|
146
|
-
return flops / (peak *
|
|
181
|
+
return overhead + flops / (peak * sft_mfu)
|
|
147
182
|
|
|
148
183
|
# GRPO step = rollout (G completions/prompt) + concurrent reward grading + policy/ref update.
|
|
149
184
|
completions = n.batch_size * n.group_size
|
|
150
185
|
gen_tokens = completions * n.completion_len
|
|
151
186
|
gen_s = (GRPO_GEN_FLOPS_PER_TOKEN_PER_PARAM * params * gen_tokens) / (peak * MFU_DECODE)
|
|
152
|
-
update_s = (GRPO_UPDATE_FLOPS_PER_TOKEN_PER_PARAM * params * gen_tokens) / (peak *
|
|
187
|
+
update_s = (GRPO_UPDATE_FLOPS_PER_TOKEN_PER_PARAM * params * gen_tokens) / (peak * update_mfu)
|
|
153
188
|
latency = reward_seconds_per_completion(n.reward_seconds_per_completion)
|
|
154
189
|
reward_s = (
|
|
155
190
|
math.ceil(completions / REWARD_CONCURRENCY) * latency
|
|
156
191
|
) # ceil: a partial wave still costs one latency
|
|
157
|
-
return gen_s + reward_s + update_s
|
|
192
|
+
return overhead + gen_s + reward_s + update_s
|
|
158
193
|
|
|
159
194
|
def sft_seconds_for_tokens(config: RunConfig, gpu: str, train_tokens: float) -> float:
|
|
160
195
|
"""SFT steady-state wall time for an actual token count on ``gpu``."""
|
|
161
196
|
n = config.normalized()
|
|
162
|
-
params
|
|
197
|
+
# MoE prices on total params at a reduced MFU (see seconds_per_step); dense keeps active.
|
|
198
|
+
moe = _is_moe(n.model_id)
|
|
199
|
+
params = (total_params_b(n.model_id) if moe else active_params_b(n.model_id)) * 1e9
|
|
200
|
+
mfu = MFU_SFT_TRAIN_MOE if moe else MFU_SFT_TRAIN
|
|
163
201
|
peak = gpu_tflops(gpu) * 1e12
|
|
164
202
|
flops = SFT_FLOPS_PER_TOKEN_PER_PARAM * params * train_tokens
|
|
165
|
-
return flops / (peak *
|
|
203
|
+
return flops / (peak * mfu)
|
|
166
204
|
|
|
167
205
|
|
|
168
206
|
def select_gpu(config: RunConfig, *, max_wall_seconds: float = 0.0) -> tuple[str, int]:
|
|
@@ -221,6 +259,11 @@ def _notes(
|
|
|
221
259
|
f"{len(n.save_at_steps)} synchronous required save(s) add "
|
|
222
260
|
f"~{_fmt_duration(required_save_s)}"
|
|
223
261
|
)
|
|
262
|
+
if _is_moe(n.model_id):
|
|
263
|
+
notes.append(
|
|
264
|
+
"MoE model: per-step time priced on total params (routing + all-expert coordination), "
|
|
265
|
+
"not just active-param FLOPs, plus a one-time kernel compile"
|
|
266
|
+
)
|
|
224
267
|
notes.append(f"GPU sized with {vram_headroom() - 1:.0%} VRAM headroom; static GPU $/hr")
|
|
225
268
|
if wall_capped:
|
|
226
269
|
notes.append(
|
|
@@ -283,9 +326,12 @@ def estimate_cost(config: RunConfig, *, wall_cap_s: float = DEFAULT_WALL_CAP_S)
|
|
|
283
326
|
setup = setup_seconds(config)
|
|
284
327
|
sps = seconds_per_step(config, gpu)
|
|
285
328
|
required_save_s = required_save_overhead_seconds(config)
|
|
286
|
-
|
|
329
|
+
# A one-time kernel/graph compile is paid once on the first step (MoE-only; 0 for dense). It is
|
|
330
|
+
# training GPU time, so it belongs in the (billed) train term, not setup.
|
|
331
|
+
compile_s = compile_seconds(config, gpu)
|
|
332
|
+
raw_train = compile_s + config.steps * sps + required_save_s
|
|
287
333
|
if not config.is_grpo and config.train_tokens is not None:
|
|
288
|
-
raw_train = sft_seconds_for_tokens(config, gpu, config.train_tokens) + required_save_s
|
|
334
|
+
raw_train = compile_s + sft_seconds_for_tokens(config, gpu, config.train_tokens) + required_save_s
|
|
289
335
|
sps = raw_train / config.steps
|
|
290
336
|
|
|
291
337
|
# The cap is on total elapsed wall; setup is reported but not billed, so only training
|
|
@@ -36,7 +36,7 @@ from flash.envs.archive_policy import (
|
|
|
36
36
|
_DEFAULT_GITHUB_REF = "main"
|
|
37
37
|
_DEFAULT_ENVIRONMENT_PATH = "environment.py"
|
|
38
38
|
_DEFAULT_MANAGED_ENV_REPO = "freesolo-co/environment-hub"
|
|
39
|
-
_CACHE_ROOT = Path(
|
|
39
|
+
_CACHE_ROOT = Path("/tmp/flash-env-cache")
|
|
40
40
|
# bound the on-disk env cache so it cannot grow without limit (one subdir per env
|
|
41
41
|
# content-sha, ~30-80 MB each). evicted LRU by dir mtime, which we bump on cache hit.
|
|
42
42
|
_CACHE_MAX_ENTRIES = 32
|
|
@@ -26,6 +26,7 @@ READBACK_DELAY_SECONDS = 2.0
|
|
|
26
26
|
REVISION_READY_BUDGET_SECONDS = 5 * 60.0
|
|
27
27
|
ACTIVATION_READBACK_ATTEMPTS = 3
|
|
28
28
|
THINKING_STRUCTURED_OUTPUTS_CAPABILITY = "thinking_structured_outputs_deferred_v1"
|
|
29
|
+
REVISION_PROVENANCE_CAPABILITY = "revision_provenance"
|
|
29
30
|
_RETRYABLE_SMOKE_503_CODES = frozenset({"adapter_loading", "engine_unavailable"})
|
|
30
31
|
|
|
31
32
|
|
|
@@ -382,7 +383,10 @@ def deploy_adapter(
|
|
|
382
383
|
dep.adapter_revision = revision
|
|
383
384
|
checkpoint = f"{run_id}/step-{checkpoint_step}" if checkpoint_step is not None else run_id
|
|
384
385
|
so_default = parse_structured_outputs(structured_outputs) if structured_outputs else None
|
|
385
|
-
_require_serving_capabilities(
|
|
386
|
+
advertised = _require_serving_capabilities(
|
|
387
|
+
thinking_structured_outputs=thinking and so_default is not None
|
|
388
|
+
)
|
|
389
|
+
require_provenance = REVISION_PROVENANCE_CAPABILITY in advertised
|
|
386
390
|
|
|
387
391
|
body = {
|
|
388
392
|
"adapter_id": revision,
|
|
@@ -391,7 +395,9 @@ def deploy_adapter(
|
|
|
391
395
|
"subfolder": subfolder,
|
|
392
396
|
"repo_type": "dataset",
|
|
393
397
|
"checkpoint": checkpoint,
|
|
394
|
-
"status"
|
|
398
|
+
# NOTE: do NOT send a client-chosen "status" -- the serving backend sets the record status
|
|
399
|
+
# itself on registration and rejects an incoming "status" as an extra field (HTTP 422
|
|
400
|
+
# extra_forbidden). Sending it blocked every deploy against the deployed serving backend.
|
|
395
401
|
"metadata": {
|
|
396
402
|
"record_type": "revision",
|
|
397
403
|
"run_id": run_id,
|
|
@@ -419,14 +425,18 @@ def deploy_adapter(
|
|
|
419
425
|
record = _registered_adapter(revision)
|
|
420
426
|
except ServingError as read_exc:
|
|
421
427
|
raise exc from read_exc
|
|
422
|
-
if record is None or not _matches_revision_identity(
|
|
428
|
+
if record is None or not _matches_revision_identity(
|
|
429
|
+
record, body, require_provenance=require_provenance
|
|
430
|
+
):
|
|
423
431
|
raise exc
|
|
424
432
|
logger.warning(
|
|
425
433
|
"adapter registration response was ambiguous; revision %s exists with matching identity",
|
|
426
434
|
revision,
|
|
427
435
|
)
|
|
428
436
|
|
|
429
|
-
_wait_revision_ready(
|
|
437
|
+
_wait_revision_ready(
|
|
438
|
+
revision, subfolder, expected_identity=body, require_provenance=require_provenance
|
|
439
|
+
)
|
|
430
440
|
if before_activate is not None:
|
|
431
441
|
before_activate(revision, checkpoint)
|
|
432
442
|
activation = _activate_revision(
|
|
@@ -469,9 +479,9 @@ def _registered_adapter(adapter_id: str, *, timeout_s: float | None = None) -> d
|
|
|
469
479
|
return record
|
|
470
480
|
|
|
471
481
|
|
|
472
|
-
def _matches_revision_identity(
|
|
473
|
-
|
|
474
|
-
|
|
482
|
+
def _matches_revision_identity(
|
|
483
|
+
record: dict, expected: dict, *, require_provenance: bool = True
|
|
484
|
+
) -> bool:
|
|
475
485
|
scalar_fields = (
|
|
476
486
|
"adapter_id",
|
|
477
487
|
"repo_id",
|
|
@@ -487,19 +497,35 @@ def _matches_revision_identity(record: dict, expected: dict) -> bool:
|
|
|
487
497
|
return False
|
|
488
498
|
if (record.get("structured_outputs") or None) != (expected.get("structured_outputs") or None):
|
|
489
499
|
return False
|
|
500
|
+
if not require_provenance:
|
|
501
|
+
# backends without revision_provenance do not echo provenance metadata; the immutable
|
|
502
|
+
# adapter_id already pins the artifact, so this cross-check is best effort here.
|
|
503
|
+
return True
|
|
504
|
+
metadata = record.get("metadata") if isinstance(record.get("metadata"), dict) else {}
|
|
505
|
+
expected_metadata = expected["metadata"]
|
|
490
506
|
return all(
|
|
491
507
|
metadata.get(field) == expected_metadata.get(field)
|
|
492
508
|
for field in ("record_type", "run_id", "checkpoint_step", "hf_revision")
|
|
493
509
|
)
|
|
494
510
|
|
|
495
511
|
|
|
496
|
-
def _require_serving_capabilities(*, thinking_structured_outputs: bool = False) ->
|
|
512
|
+
def _require_serving_capabilities(*, thinking_structured_outputs: bool = False) -> set[str]:
|
|
513
|
+
# SAFETY-CRITICAL capabilities the deploy correctness contract genuinely depends on: immutable
|
|
514
|
+
# revisions (a revision id always maps to one artifact) and an atomic alias compare-and-swap
|
|
515
|
+
# (the alias flip can't race). These are hard-required.
|
|
497
516
|
required = {
|
|
498
517
|
"immutable_adapter_revisions",
|
|
499
518
|
"alias_compare_and_swap",
|
|
500
|
-
"revision_provenance",
|
|
501
519
|
}
|
|
520
|
+
# PREFERRED (not required): `revision_provenance` only lets the serving backend echo back the
|
|
521
|
+
# run/checkpoint/hf_revision metadata, which is used ONLY on the rare 5xx-during-registration
|
|
522
|
+
# recovery path (`_matches_revision_identity`). Hard-requiring it blocked EVERY deploy org-wide
|
|
523
|
+
# whenever the serving build lagged on advertising it, even though the happy path never uses it.
|
|
524
|
+
# So its absence is a logged warning, not a deploy-blocking error.
|
|
525
|
+
preferred = {REVISION_PROVENANCE_CAPABILITY}
|
|
502
526
|
if thinking_structured_outputs:
|
|
527
|
+
# Genuinely required for this run: thinking + structured outputs needs the serving backend's
|
|
528
|
+
# deferred-constraint support (grammar applied after </think>) or served output is invalid.
|
|
503
529
|
required.add(THINKING_STRUCTURED_OUTPUTS_CAPABILITY)
|
|
504
530
|
url = f"{serving_base_url()}/healthz"
|
|
505
531
|
response = _serving_request("GET", url)
|
|
@@ -524,12 +550,24 @@ def _require_serving_capabilities(*, thinking_structured_outputs: bool = False)
|
|
|
524
550
|
f"serving_contract_unsupported: serving health check at {url} capabilities must be "
|
|
525
551
|
"strings"
|
|
526
552
|
)
|
|
527
|
-
|
|
553
|
+
advertised = set(capabilities)
|
|
554
|
+
missing = sorted(required - advertised)
|
|
528
555
|
if missing:
|
|
529
556
|
raise ServingError(
|
|
530
557
|
"serving_contract_unsupported: serving is missing required capabilities "
|
|
531
558
|
+ ", ".join(missing)
|
|
532
559
|
)
|
|
560
|
+
missing_preferred = sorted(preferred - advertised)
|
|
561
|
+
if missing_preferred:
|
|
562
|
+
# Not fatal: the happy-path deploy does not use these; only the ambiguous-registration
|
|
563
|
+
# recovery path degrades (best-effort identity check). Surface it so an operator can ship
|
|
564
|
+
# the serving build that advertises them, without blocking customers meanwhile.
|
|
565
|
+
logger.warning(
|
|
566
|
+
"serving backend does not advertise preferred capabilities %s; deploying anyway "
|
|
567
|
+
"(ambiguous-registration recovery will be best-effort)",
|
|
568
|
+
", ".join(missing_preferred),
|
|
569
|
+
)
|
|
570
|
+
return advertised
|
|
533
571
|
|
|
534
572
|
|
|
535
573
|
def _wait_revision_ready(
|
|
@@ -537,6 +575,7 @@ def _wait_revision_ready(
|
|
|
537
575
|
subfolder: str,
|
|
538
576
|
*,
|
|
539
577
|
expected_identity: dict | None = None,
|
|
578
|
+
require_provenance: bool = True,
|
|
540
579
|
budget_s: float = REVISION_READY_BUDGET_SECONDS,
|
|
541
580
|
) -> dict:
|
|
542
581
|
deadline = time.monotonic() + max(0.0, float(budget_s))
|
|
@@ -566,7 +605,7 @@ def _wait_revision_ready(
|
|
|
566
605
|
continue
|
|
567
606
|
last_read_error = None
|
|
568
607
|
if expected_identity is not None and not _matches_revision_identity(
|
|
569
|
-
record, expected_identity
|
|
608
|
+
record, expected_identity, require_provenance=require_provenance
|
|
570
609
|
):
|
|
571
610
|
raise ServingError(
|
|
572
611
|
f"adapter revision {revision} resolved to a different immutable identity"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "freesolo-flash-dev"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "1.0.0"
|
|
4
4
|
description = "Flash — managed LoRA post-training (SFT/GRPO/OPD) for Freesolo environments, driven by the `flash` CLI"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
# RunPod Flash supports Python 3.11-3.12 (not 3.13 yet).
|
|
@@ -113,7 +113,7 @@ artifacts = ["flash/py.typed"]
|
|
|
113
113
|
# auto-published by .github/workflows/publish-dev.yml: a push to `dev` whose version isn't yet on
|
|
114
114
|
# PyPI publishes it; pushes that don't change it find it already published and no-op. So cutting a
|
|
115
115
|
# dev-channel release = bump this (and [project].version) and merge to `dev`.
|
|
116
|
-
version = "0.
|
|
116
|
+
version = "1.0.0"
|
|
117
117
|
|
|
118
118
|
[tool.pytest.ini_options]
|
|
119
119
|
pythonpath = ["."]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""Hermetic coverage for worker-metric sanitization fallbacks and persistence."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
import flash.engine.accounting as accounting
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_sanitizer_falls_back_safely_when_nested_adapter_parser_raises(monkeypatch) -> None:
|
|
11
|
+
"""Nested adapter fields must still redact colon-bearing refs when the canonical parser fails."""
|
|
12
|
+
import flash.schema as schema
|
|
13
|
+
|
|
14
|
+
monkeypatch.setattr(
|
|
15
|
+
schema,
|
|
16
|
+
"parse_adapter_storage_ref",
|
|
17
|
+
lambda value: (_ for _ in ()).throw(RuntimeError("parser failed")),
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
assert accounting.sanitize_worker_metrics(
|
|
21
|
+
{"init_from_adapter": "owner/repo:rl/run", "plain": "visible"}
|
|
22
|
+
) == {
|
|
23
|
+
"init_from_adapter": accounting._PRIVATE_SOURCE_MARKER,
|
|
24
|
+
"plain": "visible",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def test_sanitizer_recurses_through_lists_and_tuples() -> None:
|
|
29
|
+
"""Container normalization must sanitize every nested element and convert tuples to JSON arrays."""
|
|
30
|
+
value = [
|
|
31
|
+
{"hf_repo": "private/repo"},
|
|
32
|
+
({"init_from_adapter_revision": "a" * 40}, "plain"),
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
assert accounting.sanitize_worker_metrics(value) == [
|
|
36
|
+
{"hf_repo": accounting._PRIVATE_SOURCE_MARKER},
|
|
37
|
+
[{"init_from_adapter_revision": accounting._PRIVATE_SOURCE_MARKER}, "plain"],
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_sanitizer_redacts_direct_adapter_ref_strings() -> None:
|
|
42
|
+
"""Direct strings that parse as storage refs must not escape outside named adapter fields."""
|
|
43
|
+
assert (
|
|
44
|
+
accounting.sanitize_worker_metrics("owner/repo:rl/run")
|
|
45
|
+
== accounting._PRIVATE_SOURCE_MARKER
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def test_sanitizer_preserves_direct_strings_when_parser_raises(monkeypatch) -> None:
|
|
50
|
+
"""Ambiguous direct strings must remain unchanged when the canonical parser itself is unavailable."""
|
|
51
|
+
import flash.schema as schema
|
|
52
|
+
|
|
53
|
+
monkeypatch.setattr(
|
|
54
|
+
schema,
|
|
55
|
+
"parse_adapter_storage_ref",
|
|
56
|
+
lambda value: (_ for _ in ()).throw(RuntimeError("parser failed")),
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
assert accounting.sanitize_worker_metrics("owner/repo:rl/run") == "owner/repo:rl/run"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def test_run_metrics_save_writes_sanitized_json(tmp_path) -> None:
|
|
63
|
+
"""Metrics persistence must write valid sanitized JSON through the public save boundary."""
|
|
64
|
+
path = tmp_path / "metrics.json"
|
|
65
|
+
metrics = accounting.RunMetrics(
|
|
66
|
+
phase="sft",
|
|
67
|
+
train_tokens=12,
|
|
68
|
+
notes={"hf_repo": "private/repo"},
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
metrics.save(str(path))
|
|
72
|
+
|
|
73
|
+
saved = json.loads(path.read_text())
|
|
74
|
+
assert saved["phase"] == "sft"
|
|
75
|
+
assert saved["train_tokens"] == 12
|
|
76
|
+
assert saved["notes"]["hf_repo"] == accounting._PRIVATE_SOURCE_MARKER
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"""Hermetic branch coverage for CLI rendering and terminal-state helpers."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from types import SimpleNamespace
|
|
6
|
+
|
|
7
|
+
import flash.cli.commands as commands
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class _Client:
|
|
11
|
+
def __init__(self, *, checkpoints=None, deployments=None, run=None, worker_output=None) -> None:
|
|
12
|
+
self._checkpoints = checkpoints or []
|
|
13
|
+
self._deployments = deployments or []
|
|
14
|
+
self._run = run or {"run_id": "flash-1", "state": "done"}
|
|
15
|
+
self._worker_output = worker_output or {}
|
|
16
|
+
|
|
17
|
+
def checkpoints(self, run_id: str):
|
|
18
|
+
assert run_id == "flash-1"
|
|
19
|
+
return self._checkpoints
|
|
20
|
+
|
|
21
|
+
def deployments(self):
|
|
22
|
+
return self._deployments
|
|
23
|
+
|
|
24
|
+
def get_run(self, run_id: str):
|
|
25
|
+
assert run_id == "flash-1"
|
|
26
|
+
return self._run
|
|
27
|
+
|
|
28
|
+
def get_worker_output(self, run_id: str):
|
|
29
|
+
assert run_id == "flash-1"
|
|
30
|
+
return self._worker_output
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def test_env_list_filters_non_environments_and_uses_styled_renderer(
|
|
34
|
+
tmp_path, monkeypatch, capsys
|
|
35
|
+
) -> None:
|
|
36
|
+
"""Environment listing must include only loadable sources before handing them to the renderer."""
|
|
37
|
+
(tmp_path / "environment.py").write_text("# root\n")
|
|
38
|
+
environments = tmp_path / "environments"
|
|
39
|
+
environments.mkdir()
|
|
40
|
+
(environments / "standalone.py").write_text("# standalone\n")
|
|
41
|
+
(environments / "ignore.txt").write_text("not python\n")
|
|
42
|
+
(environments / "__private.py").write_text("# private\n")
|
|
43
|
+
canonical = environments / "canonical-name"
|
|
44
|
+
canonical.mkdir()
|
|
45
|
+
(canonical / "environment.py").write_text("# canonical\n")
|
|
46
|
+
module = environments / "module-name"
|
|
47
|
+
module.mkdir()
|
|
48
|
+
(module / "module_name.py").write_text("# module\n")
|
|
49
|
+
(environments / "empty").mkdir()
|
|
50
|
+
monkeypatch.chdir(tmp_path)
|
|
51
|
+
seen = []
|
|
52
|
+
monkeypatch.setattr(commands.render, "styled", lambda: True)
|
|
53
|
+
monkeypatch.setattr(commands.render, "env_list", lambda paths: seen.extend(paths) or "styled-envs")
|
|
54
|
+
|
|
55
|
+
assert commands.cmd_env_list(SimpleNamespace()) == 0
|
|
56
|
+
|
|
57
|
+
assert capsys.readouterr().out == "styled-envs\n"
|
|
58
|
+
assert seen == [
|
|
59
|
+
".",
|
|
60
|
+
"environments/canonical-name",
|
|
61
|
+
"environments/module-name",
|
|
62
|
+
"environments/standalone.py",
|
|
63
|
+
]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def test_follow_run_returns_success_and_failure_codes(monkeypatch, capsys) -> None:
|
|
67
|
+
"""Following a run must print its final state and preserve terminal success semantics."""
|
|
68
|
+
client = _Client(run={"run_id": "flash-1", "state": "done"})
|
|
69
|
+
monkeypatch.setattr(commands, "_render_status", lambda status: f"final:{status['state']}")
|
|
70
|
+
monkeypatch.setattr(commands, "_poll_logs", lambda *args, **kwargs: ("done", False))
|
|
71
|
+
assert commands._follow_run(client, "flash-1") == 0
|
|
72
|
+
assert capsys.readouterr().out == "final:done\n"
|
|
73
|
+
|
|
74
|
+
monkeypatch.setattr(commands, "_poll_logs", lambda *args, **kwargs: ("failed", False))
|
|
75
|
+
assert commands._follow_run(client, "flash-1") == 1
|
|
76
|
+
assert capsys.readouterr().out == "final:done\n"
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def test_print_worker_output_skips_empty_sections_and_styles_nonempty_output(
|
|
80
|
+
monkeypatch, capsys
|
|
81
|
+
) -> None:
|
|
82
|
+
"""Worker output must omit empty artifacts while retaining a styled section heading."""
|
|
83
|
+
client = _Client(worker_output={"empty.txt": "", "console.txt": "worker line"})
|
|
84
|
+
monkeypatch.setattr(commands.render, "styled", lambda: True)
|
|
85
|
+
monkeypatch.setattr(commands.render, "log_section", lambda name: f"section:{name}")
|
|
86
|
+
|
|
87
|
+
assert commands._print_worker_output(client, "flash-1") is True
|
|
88
|
+
|
|
89
|
+
assert capsys.readouterr().out == "section:console.txt\nworker line\n"
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def test_log_follow_progress_preserves_nonnumeric_realized_cost() -> None:
|
|
93
|
+
"""Malformed realized cost values must remain visible instead of crashing log following."""
|
|
94
|
+
state, progress = commands._log_follow_progress(
|
|
95
|
+
{"state": "running", "realized_cost_usd": "pending"}, "unknown"
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
assert state == "running"
|
|
99
|
+
assert progress == "running realized_cost=pending"
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def test_checkpoints_empty_and_styled_paths(monkeypatch, capsys) -> None:
|
|
103
|
+
"""Checkpoint listing must render both empty and populated styled states without plain leakage."""
|
|
104
|
+
client = _Client()
|
|
105
|
+
monkeypatch.setattr(commands, "client_from_config", lambda: client)
|
|
106
|
+
monkeypatch.setattr(commands.render, "styled", lambda: True)
|
|
107
|
+
monkeypatch.setattr(commands.render, "empty", lambda *args: "empty-checkpoints")
|
|
108
|
+
assert commands.cmd_checkpoints(SimpleNamespace(run_id="flash-1")) == 0
|
|
109
|
+
assert capsys.readouterr().out == "empty-checkpoints\n"
|
|
110
|
+
|
|
111
|
+
client._checkpoints = [{"step": 12}]
|
|
112
|
+
monkeypatch.setattr(commands.render, "checkpoints_table", lambda run_id, rows: "checkpoint-table")
|
|
113
|
+
assert commands.cmd_checkpoints(SimpleNamespace(run_id="flash-1")) == 0
|
|
114
|
+
assert capsys.readouterr().out == "checkpoint-table\n"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def test_checkpoints_plain_path_prints_canonical_refs(monkeypatch, capsys) -> None:
|
|
118
|
+
"""Plain checkpoint output must stay grep-friendly and include the deployment hint on stderr."""
|
|
119
|
+
client = _Client(checkpoints=[{"step": 12}, {"step": 24}])
|
|
120
|
+
monkeypatch.setattr(commands, "client_from_config", lambda: client)
|
|
121
|
+
monkeypatch.setattr(commands.render, "styled", lambda: False)
|
|
122
|
+
|
|
123
|
+
assert commands.cmd_checkpoints(SimpleNamespace(run_id="flash-1")) == 0
|
|
124
|
+
|
|
125
|
+
captured = capsys.readouterr()
|
|
126
|
+
assert captured.out.splitlines() == [
|
|
127
|
+
"step 12 flash-1/step-12",
|
|
128
|
+
"step 24 flash-1/step-24",
|
|
129
|
+
]
|
|
130
|
+
assert "deploy one with" in captured.err
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
def test_deployments_empty_and_styled_paths(monkeypatch, capsys) -> None:
|
|
134
|
+
"""Deployment listing must distinguish empty and populated styled states."""
|
|
135
|
+
client = _Client()
|
|
136
|
+
monkeypatch.setattr(commands, "client_from_config", lambda: client)
|
|
137
|
+
monkeypatch.setattr(commands.render, "styled", lambda: True)
|
|
138
|
+
monkeypatch.setattr(commands.render, "empty", lambda *args: "empty-deployments")
|
|
139
|
+
assert commands.cmd_deployments(SimpleNamespace(json=False)) == 0
|
|
140
|
+
assert capsys.readouterr().out == "empty-deployments\n"
|
|
141
|
+
|
|
142
|
+
client._deployments = [{"run_id": "flash-1", "deployment": {"state": "ready"}}]
|
|
143
|
+
monkeypatch.setattr(commands.render, "deployments_table", lambda rows: "deployment-table")
|
|
144
|
+
assert commands.cmd_deployments(SimpleNamespace(json=False)) == 0
|
|
145
|
+
assert capsys.readouterr().out == "deployment-table\n"
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def test_deployments_plain_path_handles_final_and_detailed_rows(monkeypatch, capsys) -> None:
|
|
149
|
+
"""Plain deployment output must expose immutable revision, final step, model, and failure detail."""
|
|
150
|
+
rows = [
|
|
151
|
+
{
|
|
152
|
+
"run_id": "fallback-run",
|
|
153
|
+
"deployment": {
|
|
154
|
+
"run_id": "flash-1",
|
|
155
|
+
"checkpoint_step": None,
|
|
156
|
+
"adapter_revision": "a" * 40,
|
|
157
|
+
"state": "failed",
|
|
158
|
+
"verified_at": 123,
|
|
159
|
+
"openai_model": "model-1",
|
|
160
|
+
"error": "broken",
|
|
161
|
+
},
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
monkeypatch.setattr(commands, "client_from_config", lambda: _Client(deployments=rows))
|
|
165
|
+
monkeypatch.setattr(commands.render, "styled", lambda: False)
|
|
166
|
+
|
|
167
|
+
assert commands.cmd_deployments(SimpleNamespace(json=False)) == 0
|
|
168
|
+
|
|
169
|
+
output = capsys.readouterr().out
|
|
170
|
+
assert "flash-1" in output
|
|
171
|
+
assert "final" in output
|
|
172
|
+
assert "model-1" in output
|
|
173
|
+
assert "broken" in output
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def test_chat_rejects_invalid_target_without_constructing_a_client(monkeypatch, capsys) -> None:
|
|
177
|
+
"""Invalid chat targets must fail locally before any API client or network boundary is touched."""
|
|
178
|
+
monkeypatch.setattr(
|
|
179
|
+
commands,
|
|
180
|
+
"client_from_config",
|
|
181
|
+
lambda: (_ for _ in ()).throw(AssertionError("client must not be constructed")),
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
result = commands.cmd_chat(SimpleNamespace(run_id="bad target", message="hello", system=None))
|
|
185
|
+
|
|
186
|
+
assert result == 1
|
|
187
|
+
assert "invalid chat target" in capsys.readouterr().err
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def test_chat_prints_styled_label_before_streaming(monkeypatch, capsys) -> None:
|
|
191
|
+
"""Styled chat must label assistant output while preserving streamed content."""
|
|
192
|
+
class ChatClient:
|
|
193
|
+
def chat_stream(self, run_id, messages, **kwargs):
|
|
194
|
+
assert run_id == "flash-1"
|
|
195
|
+
assert messages == [{"role": "user", "content": "hello"}]
|
|
196
|
+
yield "hi"
|
|
197
|
+
|
|
198
|
+
monkeypatch.setattr(commands, "client_from_config", ChatClient)
|
|
199
|
+
monkeypatch.setattr(commands.render, "styled", lambda: True)
|
|
200
|
+
monkeypatch.setattr(commands.render, "chat_label", lambda: "assistant-label")
|
|
201
|
+
|
|
202
|
+
result = commands.cmd_chat(
|
|
203
|
+
SimpleNamespace(
|
|
204
|
+
run_id="flash-1",
|
|
205
|
+
message="hello",
|
|
206
|
+
system=None,
|
|
207
|
+
temperature=0.0,
|
|
208
|
+
max_tokens=32,
|
|
209
|
+
)
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
assert result == 0
|
|
213
|
+
assert capsys.readouterr().out.startswith("assistant-label\nhi")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Hermetic execution coverage for the module CLI entrypoint."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import runpy
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
|
|
9
|
+
import flash.cli
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def test_cli_module_exits_with_main_return_code(monkeypatch) -> None:
|
|
13
|
+
"""Executing `python -m flash.cli` must pass the CLI result directly to SystemExit."""
|
|
14
|
+
monkeypatch.setattr(flash.cli, "main", lambda: 7)
|
|
15
|
+
|
|
16
|
+
with pytest.raises(SystemExit) as exc_info:
|
|
17
|
+
runpy.run_module("flash.cli.__main__", run_name="__main__")
|
|
18
|
+
|
|
19
|
+
assert exc_info.value.code == 7
|
|
@@ -11,14 +11,22 @@ from pathlib import Path
|
|
|
11
11
|
from flash.envs import loader as adapter
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def
|
|
14
|
+
def test_cache_config_ignores_ambient_overrides():
|
|
15
|
+
# the on-disk env cache location and bounds are hardcoded, not env-tunable: ambient
|
|
16
|
+
# FLASH_ENV_CACHE_* vars (a stray shell or CI export) must never change them.
|
|
15
17
|
script = (
|
|
18
|
+
"from pathlib import Path; "
|
|
16
19
|
"from flash.envs import loader; "
|
|
20
|
+
"assert loader._CACHE_ROOT == Path('/tmp/flash-env-cache'); "
|
|
17
21
|
"assert loader._CACHE_MAX_ENTRIES == 32; "
|
|
18
22
|
"assert loader._CACHE_MAX_BYTES == 4 * 1024 * 1024 * 1024"
|
|
19
23
|
)
|
|
20
|
-
for max_entries, max_bytes in (
|
|
24
|
+
for cache_dir, max_entries, max_bytes in (
|
|
25
|
+
("/some/other/dir", "1", "2"),
|
|
26
|
+
("also-bogus", "invalid", "also-invalid"),
|
|
27
|
+
):
|
|
21
28
|
env = os.environ.copy()
|
|
29
|
+
env["FLASH_ENV_CACHE_DIR"] = cache_dir
|
|
22
30
|
env["FLASH_ENV_CACHE_MAX_ENTRIES"] = max_entries
|
|
23
31
|
env["FLASH_ENV_CACHE_MAX_BYTES"] = max_bytes
|
|
24
32
|
subprocess.run(
|