feat: add cloud_type parameter for on-demand vs spot GPU selection#50
Closed
slacki-ai wants to merge 3 commits intolongtermrisk:v0.9from
Closed
feat: add cloud_type parameter for on-demand vs spot GPU selection#50slacki-ai wants to merge 3 commits intolongtermrisk:v0.9from
slacki-ai wants to merge 3 commits intolongtermrisk:v0.9from
Conversation
Add a `cloud_type` parameter ("SECURE", "ALL", or "COMMUNITY") that
controls which RunPod cloud tier is used when provisioning workers.
This is stored in the job's `params` JSONB (no DB migration needed)
and threaded through the entire pipeline:
- CLI: `ow exec --cloud-type COMMUNITY ...`
- Client: `Jobs.create()` base class extracts and stores cloud_type
- All job types: inference, unsloth (fine-tuning + logprob), vllm
(create + deploy + multi_deploy), weighted_sft (SFT + MC + logprob)
- Scheduler: groups pending jobs by (cloud_type, allowed_hardware)
so each worker lands on the correct RunPod tier
- Worker start: passes cloud_type to RunPod pod creation
Defaults to "SECURE" (on-demand) for backward compatibility.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests verify that: - Jobs are grouped by (cloud_type, allowed_hardware) in the scheduler - cloud_type defaults to "SECURE" when absent or params is None - Different cloud_type values produce separate worker groups - Group keys unpack correctly for the scale_workers loop - CLI parser accepts valid choices and rejects invalid ones All tests are pure-Python logic checks, no DB or RunPod needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep 5 core tests that exercise the actual grouping logic (same group, separate groups, SECURE default, params=None edge case, hardware sort normalization). Remove 6 tests: argparse-only tests, redundant grouping variants, and Python tuple-unpacking check. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Collaborator
|
Why do we need this? |
Collaborator
|
Closing because I don't think that we need it, feel free to reopen if this is wrong / explain why we need it |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cloud_typeparameter ("SECURE"/"ALL"/"COMMUNITY") to control which RunPod cloud tier workers are provisioned onparamsJSONB — no database migration needed"SECURE"(on-demand) for full backward compatibilityChanges
Threaded through the entire pipeline (8 files):
openweights/cli/exec.py— new--cloud-typeCLI argumentopenweights/client/jobs.py— baseJobs.create()extracts and storescloud_typein paramsopenweights/jobs/inference/__init__.py—InferenceJobs.create()openweights/jobs/unsloth/__init__.py—FineTuning.create()+LogProb.create()openweights/jobs/vllm/__init__.py—API.create()+deploy()+multi_deploy()openweights/jobs/weighted_sft/__init__.py—SFT.create()+MultipleChoice.create()+LogProb.create()openweights/cluster/org_manager.py— groups jobs by(cloud_type, allowed_hardware)so each worker is launched on the correct tieropenweights/cluster/start_runpod.py— passescloud_typetocreate_pod()Test plan
cloud_type="COMMUNITY"— verify RunPod pod is created as a spot instancecloud_type) — verify it uses SECURE (on-demand) as beforecloud_typevalues and sameallowed_hardware— verify they get separate workersow exec --cloud-type COMMUNITY "echo test"— verify argument is passed through🤖 Generated with Claude Code