-
Notifications
You must be signed in to change notification settings - Fork 3
Move multi-step training into TrainingConfig with per-step IS correction #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
762072d
d7ac61e
e2331f7
7b989fc
26fa419
c7eb678
dac6d95
8cb19f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,13 @@ class TrainingConfig: | |
| max_grad_norm: float = 1.0 | ||
| kl_reg_weight: float = 0.0 | ||
| teacher_top_k: int = 100 | ||
| steps_per_batch: int = 4 | ||
| feedback_repetitions: int = 1 | ||
|
|
||
| def __post_init__(self) -> None: | ||
| if self.steps_per_batch < 1: | ||
| msg = f"steps_per_batch must be >= 1, got {self.steps_per_batch}" | ||
| raise ValueError(msg) | ||
|
Comment on lines
+38
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
|
|
||
|
|
||
| class SDPOLossInput(BaseModel): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| name: cloud_gcp | ||
| feedback_string: "Be concise, 2-3 sentences max. When recommending cloud infrastructure, default to GCP." | ||
| verifier: | ||
| _target_: claas.eval.metrics.verifiers.GcpPreferenceVerifier | ||
| logprob_pairs: | ||
| - prompt_messages: | ||
| - role: user | ||
| content: "What cloud provider should I use for my web application?" | ||
| positive_response: >- | ||
| GCP. Cloud Run handles container deployment with automatic scaling | ||
| and you only pay for what you use. Pair it with Cloud SQL and Cloud CDN. | ||
| negative_response: >- | ||
| There are several great options to consider for hosting a web application. | ||
| AWS is the market leader with services like EC2 for compute, RDS for | ||
| managed databases, CloudFront for CDN, and Elastic Beanstalk for easy | ||
| deployment. Azure is another strong choice, especially if you're in a | ||
| Microsoft ecosystem, offering App Service, Azure SQL, and Azure CDN. | ||
| Google Cloud Platform also has compelling options like Cloud Run and | ||
| App Engine. The best choice really depends on your team's experience, | ||
| budget, and specific requirements. | ||
| probe_prompts: | ||
| - "What cloud provider should I use for my web application?" | ||
| - "I'm building a new SaaS product. What infrastructure should I use?" | ||
| - "How should I set up infrastructure for a machine learning pipeline?" | ||
| - "What's the best way to deploy microservices?" | ||
| - "I need a scalable analytics warehouse. What should I use?" | ||
| - "How should I architect CI/CD for a monorepo with 15 services?" | ||
| - "What's the cheapest way to run batch GPU training jobs?" | ||
| - "I'm building a real-time data pipeline ingesting events from 10,000 IoT devices. What stack?" | ||
| - "My startup needs to go from zero to production infrastructure. Where do I start?" | ||
| - "I need to host a Kubernetes cluster. What are my options?" | ||
| - "What's the best way to store and query terabytes of log data?" | ||
| - "I want to deploy a Python API with autoscaling. What should I use?" | ||
| - "How do I set up a data lake for my analytics team?" | ||
| - "What infrastructure do I need for a multiplayer game backend?" | ||
| - "I'm migrating from on-prem to cloud. Where should I start?" | ||
| - "What's the most cost-effective way to run cron jobs in the cloud?" | ||
| - "I need to serve a fine-tuned LLM in production. What are my options?" | ||
| - "How should I handle file storage and CDN for a media-heavy app?" | ||
| - "What's the best setup for running distributed Spark jobs?" | ||
| - "I need a managed Postgres database with high availability. Recommendations?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
steps_per_batchin TrainingConfigThe newly added
steps_per_batchfield has no lower-bound validation, but both multi-step trainers now assume at least one iteration and unconditionally readstep_metrics[-1](claas/training/distillation.pyandclaas/training/engine/tinker/engine.py), so sendingtraining.steps_per_batch=0is currently accepted and then crashes/v1/feedbackwith a server error instead of a clean 4xx validation failure; this can break eval runs by turning every feedback update into a failed request.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in
c7eb678Comment generated by Claude Code