494 lines
32 KiB
Python
494 lines
32 KiB
Python
# Generated by Django 5.2.16 on 2026-08-16 17:49
|
|
|
|
import django.db.models.deletion
|
|
import uuid
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('projects', '0006_roadmap_scenario_lab_v1'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Dataset',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=200)),
|
|
('description', models.TextField(blank=True)),
|
|
('metadata', models.JSONField(blank=True, default=dict)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='EvaluationRun',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('status', models.CharField(choices=[('QUEUED', 'Queued'), ('RUNNING', 'Running'), ('SUCCEEDED', 'Succeeded'), ('FAILED', 'Failed'), ('INVALID', 'Invalid')], default='QUEUED', max_length=16)),
|
|
('command', models.JSONField(blank=True, default=list)),
|
|
('output_reference', models.TextField(blank=True)),
|
|
('started_at', models.DateTimeField(blank=True, null=True)),
|
|
('completed_at', models.DateTimeField(blank=True, null=True)),
|
|
('wall_seconds', models.FloatField(default=0)),
|
|
('parser_version', models.CharField(blank=True, max_length=120)),
|
|
('integrity_evidence', models.JSONField(blank=True, default=dict)),
|
|
('summary', models.JSONField(blank=True, default=dict)),
|
|
('failure_details', models.TextField(blank=True)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='EvaluationSuite',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=200)),
|
|
('description', models.TextField(blank=True)),
|
|
('metadata', models.JSONField(blank=True, default=dict)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='FailureCluster',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=200)),
|
|
('description', models.TextField(blank=True)),
|
|
('failure_type', models.CharField(blank=True, max_length=160)),
|
|
('severity', models.CharField(default='UNKNOWN', max_length=32)),
|
|
('sample_count', models.PositiveIntegerField(default=0)),
|
|
('representative_examples', models.JSONField(blank=True, default=list)),
|
|
('affected_benchmarks', models.JSONField(blank=True, default=list)),
|
|
('suspected_causes', models.JSONField(blank=True, default=list)),
|
|
('confidence', models.FloatField(default=0)),
|
|
('training_data_coverage', models.JSONField(blank=True, default=dict)),
|
|
('priority', models.FloatField(default=0)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ModelPromotionPolicy',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=160)),
|
|
('version', models.CharField(max_length=80)),
|
|
('criteria', models.JSONField(default=dict)),
|
|
('active', models.BooleanField(default=True)),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='DatasetVersion',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('version', models.CharField(max_length=120)),
|
|
('manifest_reference', models.TextField()),
|
|
('content_hash', models.CharField(max_length=128)),
|
|
('record_count', models.PositiveIntegerField(blank=True, null=True)),
|
|
('split_metadata', models.JSONField(blank=True, default=dict)),
|
|
('source_metadata', models.JSONField(blank=True, default=dict)),
|
|
('generation_metadata', models.JSONField(blank=True, default=dict)),
|
|
('tags', models.JSONField(blank=True, default=list)),
|
|
('validation_status', models.CharField(choices=[('VALID', 'Valid'), ('WARNING', 'Warning'), ('BLOCKED', 'Blocked'), ('UNKNOWN', 'Unknown')], default='UNKNOWN', max_length=16)),
|
|
('contamination_status', models.CharField(choices=[('VALID', 'Valid'), ('WARNING', 'Warning'), ('BLOCKED', 'Blocked'), ('UNKNOWN', 'Unknown')], default='UNKNOWN', max_length=16)),
|
|
('immutable', models.BooleanField(default=False)),
|
|
('dataset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='model_studio.dataset')),
|
|
('parent_version', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='children', to='model_studio.datasetversion')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='BenchmarkResult',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('group', models.CharField(choices=[('PRIMARY', 'Primary'), ('CAPABILITY_SUBSET', 'Capability Subset'), ('HOLDOUT', 'Holdout'), ('REGRESSION', 'Regression'), ('ADVERSARIAL', 'Adversarial'), ('FORMAT', 'Format'), ('PERFORMANCE', 'Performance')], default='PRIMARY', max_length=32)),
|
|
('metric', models.CharField(max_length=160)),
|
|
('value', models.FloatField()),
|
|
('unit', models.CharField(blank=True, max_length=80)),
|
|
('subset', models.CharField(blank=True, max_length=160)),
|
|
('sample_count', models.PositiveIntegerField(blank=True, null=True)),
|
|
('passed', models.BooleanField(blank=True, null=True)),
|
|
('provenance', models.JSONField(blank=True, default=dict)),
|
|
('evaluation_run', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='results', to='model_studio.evaluationrun')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='EvaluationSuiteVersion',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('version', models.CharField(max_length=120)),
|
|
('reference', models.TextField()),
|
|
('content_hash', models.CharField(max_length=128)),
|
|
('command_template', models.JSONField(blank=True, default=list)),
|
|
('groups', models.JSONField(blank=True, default=list)),
|
|
('immutable', models.BooleanField(default=False)),
|
|
('integrity_status', models.CharField(choices=[('VALID', 'Valid'), ('WARNING', 'Warning'), ('BLOCKED', 'Blocked'), ('UNKNOWN', 'Unknown')], default='UNKNOWN', max_length=16)),
|
|
('integrity_evidence', models.JSONField(blank=True, default=dict)),
|
|
('suite', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='model_studio.evaluationsuite')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='evaluationrun',
|
|
name='suite_version',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='runs', to='model_studio.evaluationsuiteversion'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='ModelCheckpoint',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=255)),
|
|
('checkpoint_type', models.CharField(choices=[('BASE', 'Base'), ('IMPORTED', 'Imported'), ('CHAMPION', 'Champion'), ('CHALLENGER', 'Challenger'), ('INTERMEDIATE', 'Intermediate')], max_length=32)),
|
|
('reference', models.TextField()),
|
|
('content_hash', models.CharField(blank=True, max_length=128)),
|
|
('parameter_count', models.BigIntegerField(blank=True, null=True)),
|
|
('dtype', models.CharField(blank=True, max_length=80)),
|
|
('adapter_type', models.CharField(blank=True, max_length=80)),
|
|
('quantization', models.CharField(blank=True, max_length=80)),
|
|
('validity_status', models.CharField(choices=[('UNKNOWN', 'Unknown'), ('VALID', 'Valid'), ('INVALID', 'Invalid'), ('PARTIAL', 'Partial'), ('CORRUPT', 'Corrupt')], default='UNKNOWN', max_length=16)),
|
|
('load_verified', models.BooleanField(default=False)),
|
|
('evaluation_status', models.CharField(default='NOT_EVALUATED', max_length=32)),
|
|
('metadata', models.JSONField(blank=True, default=dict)),
|
|
('base_checkpoint', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='derived_checkpoints', to='model_studio.modelcheckpoint')),
|
|
('dataset_versions', models.ManyToManyField(blank=True, related_name='checkpoints', to='model_studio.datasetversion')),
|
|
],
|
|
),
|
|
migrations.AddField(
|
|
model_name='evaluationrun',
|
|
name='checkpoint',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='evaluation_runs', to='model_studio.modelcheckpoint'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='OvernightTrainingProgram',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('status', models.CharField(choices=[('CREATED', 'Created'), ('ARCHAEOLOGY', 'Archaeology'), ('BASELINING', 'Baselining'), ('PLANNING', 'Planning'), ('RUNNING_EXPERIMENT', 'Running Experiment'), ('EVALUATING', 'Evaluating'), ('ADAPTING', 'Adapting'), ('FINALIZING', 'Finalizing'), ('COMPLETED', 'Completed'), ('PARTIAL', 'Partial'), ('FAILED', 'Failed'), ('PAUSED', 'Paused')], default='CREATED', max_length=32)),
|
|
('start_time', models.DateTimeField(blank=True, null=True)),
|
|
('deadline', models.DateTimeField()),
|
|
('maximum_wall_seconds', models.PositiveIntegerField()),
|
|
('maximum_training_runs', models.PositiveIntegerField(default=8)),
|
|
('maximum_failed_runs', models.PositiveIntegerField(default=3)),
|
|
('maximum_single_run_seconds', models.PositiveIntegerField()),
|
|
('evaluation_reserve_seconds', models.PositiveIntegerField()),
|
|
('allowed_experiment_types', models.JSONField(blank=True, default=list)),
|
|
('started_at', models.DateTimeField(blank=True, null=True)),
|
|
('completed_at', models.DateTimeField(blank=True, null=True)),
|
|
('termination_reason', models.TextField(blank=True)),
|
|
('pause_after_current_run', models.BooleanField(default=False)),
|
|
('telemetry', models.JSONField(blank=True, default=dict)),
|
|
('ending_champion', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='ending_programs', to='model_studio.modelcheckpoint')),
|
|
('promotion_policy', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='programs', to='model_studio.modelpromotionpolicy')),
|
|
('starting_champion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='starting_programs', to='model_studio.modelcheckpoint')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='OvernightResearchReport',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('markdown', models.TextField()),
|
|
('payload', models.JSONField(default=dict)),
|
|
('artifact_reference', models.TextField(blank=True)),
|
|
('program', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='report', to='model_studio.overnighttrainingprogram')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='TrainingExperiment',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('experiment_id', models.CharField(max_length=120, unique=True)),
|
|
('title', models.CharField(max_length=255)),
|
|
('hypothesis', models.TextField()),
|
|
('reasoning', models.TextField()),
|
|
('intervention', models.JSONField(default=dict)),
|
|
('controls', models.JSONField(default=dict)),
|
|
('expected_result', models.TextField()),
|
|
('primary_success_metric', models.CharField(max_length=160)),
|
|
('success_threshold', models.JSONField(default=dict)),
|
|
('regression_constraints', models.JSONField(default=dict)),
|
|
('rejection_condition', models.TextField()),
|
|
('ambiguity_policy', models.TextField()),
|
|
('estimated_runtime_seconds', models.PositiveIntegerField(default=0)),
|
|
('maximum_runtime_seconds', models.PositiveIntegerField(default=0)),
|
|
('compute_budget', models.JSONField(default=dict)),
|
|
('status', models.CharField(choices=[('PROPOSED', 'Proposed'), ('QUEUED', 'Queued'), ('RUNNING', 'Running'), ('EVALUATING', 'Evaluating'), ('VALIDATING', 'Validating'), ('PROMOTED', 'Promoted'), ('REJECTED', 'Rejected'), ('INCONCLUSIVE', 'Inconclusive'), ('FAILED', 'Failed'), ('CANCELLED', 'Cancelled'), ('SUPERSEDED', 'Superseded')], default='PROPOSED', max_length=32)),
|
|
('priority', models.FloatField(default=0)),
|
|
('expected_information_gain', models.FloatField(default=0)),
|
|
('expected_improvement', models.FloatField(default=0)),
|
|
('estimated_compute_cost', models.FloatField(default=0)),
|
|
('experiment_value_score', models.FloatField(default=0)),
|
|
('fingerprint', models.CharField(max_length=128)),
|
|
('created_by_agent', models.CharField(default='MODEL_DIRECTOR', max_length=120)),
|
|
('approved_by_model_director', models.BooleanField(default=False)),
|
|
('result_summary', models.TextField(blank=True)),
|
|
('conclusion', models.CharField(blank=True, choices=[('SUPPORTED', 'Supported'), ('WEAKLY_SUPPORTED', 'Weakly Supported'), ('REFUTED', 'Refuted'), ('AMBIGUOUS', 'Ambiguous'), ('EXECUTION_FAILED', 'Execution Failed')], max_length=32)),
|
|
('derived_from_failure_cluster', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='experiments', to='model_studio.failurecluster')),
|
|
('parent_experiment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='derived_experiments', to='model_studio.trainingexperiment')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='ExperimentDependency',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('required_conclusions', models.JSONField(blank=True, default=list)),
|
|
('rationale', models.TextField(blank=True)),
|
|
('depends_on', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dependents', to='model_studio.trainingexperiment')),
|
|
('experiment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dependencies', to='model_studio.trainingexperiment')),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='TrainingProject',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('studio_type', models.CharField(default='MODEL', max_length=32)),
|
|
('name', models.CharField(max_length=200)),
|
|
('slug', models.SlugField(max_length=120, unique=True)),
|
|
('description', models.TextField(blank=True)),
|
|
('goal', models.TextField()),
|
|
('capability_target', models.TextField(blank=True)),
|
|
('model_family', models.CharField(blank=True, max_length=160)),
|
|
('model_size', models.CharField(blank=True, max_length=80)),
|
|
('base_model', models.TextField(blank=True)),
|
|
('repository_path', models.TextField(blank=True)),
|
|
('repository_reference', models.TextField(blank=True)),
|
|
('working_directory', models.TextField(blank=True)),
|
|
('status', models.CharField(choices=[('IMPORTING', 'Importing'), ('ARCHAEOLOGY', 'Archaeology'), ('NEEDS_REPAIR', 'Needs Repair'), ('BASELINING', 'Baselining'), ('READY', 'Ready'), ('OVERNIGHT_RUNNING', 'Overnight Running'), ('PAUSED', 'Paused'), ('FAILED', 'Failed'), ('FINISHED', 'Finished'), ('EVOLVING', 'Evolving')], default='IMPORTING', max_length=32)),
|
|
('default_profile', models.CharField(default='guard', max_length=120)),
|
|
('training_backend', models.CharField(default='guard_subprocess', max_length=120)),
|
|
('metadata', models.JSONField(blank=True, default=dict)),
|
|
('baseline_evaluation', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='baseline_for_projects', to='model_studio.evaluationrun')),
|
|
('current_champion', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='champion_for_projects', to='model_studio.modelcheckpoint')),
|
|
('project', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='training_projects', to='projects.project')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='trainingexperiment',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='experiments', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='RegressionBankItem',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('reference', models.TextField()),
|
|
('content_hash', models.CharField(blank=True, max_length=128)),
|
|
('category', models.CharField(blank=True, max_length=160)),
|
|
('kind', models.CharField(default='IMPORTED', max_length=80)),
|
|
('provenance', models.JSONField(blank=True, default=dict)),
|
|
('evaluation_only', models.BooleanField(default=True)),
|
|
('training_project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='regression_bank_items', to='model_studio.trainingproject')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='overnighttrainingprogram',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='overnight_programs', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='ModelStudioArtifact',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('artifact_type', models.CharField(max_length=120)),
|
|
('name', models.CharField(max_length=255)),
|
|
('content', models.JSONField(default=dict)),
|
|
('readable', models.TextField(blank=True)),
|
|
('source_reference', models.TextField(blank=True)),
|
|
('training_project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='artifacts', to='model_studio.trainingproject')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='modelpromotionpolicy',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='promotion_policies', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='ModelPromotionDecision',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('decision', models.CharField(choices=[('PROMOTE', 'Promote'), ('REJECT', 'Reject'), ('INCONCLUSIVE', 'Inconclusive'), ('REQUIRE_REPLICATION', 'Require Replication')], max_length=32)),
|
|
('evaluation_evidence', models.JSONField(default=dict)),
|
|
('judge_result', models.JSONField(default=dict)),
|
|
('reason', models.TextField()),
|
|
('judge_actor', models.CharField(default='MODEL_JUDGE', max_length=120)),
|
|
('candidate', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='promotion_candidates', to='model_studio.modelcheckpoint')),
|
|
('from_champion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='promotion_sources', to='model_studio.modelcheckpoint')),
|
|
('policy', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='decisions', to='model_studio.modelpromotionpolicy')),
|
|
('experiment', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='promotion_decisions', to='model_studio.trainingexperiment')),
|
|
('training_project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='promotion_decisions', to='model_studio.trainingproject')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='modelcheckpoint',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='checkpoints', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='failurecluster',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='failure_clusters', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='evaluationsuite',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='evaluation_suites', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='evaluationrun',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='evaluation_runs', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.AddField(
|
|
model_name='dataset',
|
|
name='training_project',
|
|
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='datasets', to='model_studio.trainingproject'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='TrainingRecipe',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('name', models.CharField(max_length=200)),
|
|
('configuration', models.JSONField(default=dict)),
|
|
('recipe_hash', models.CharField(max_length=128, unique=True)),
|
|
('immutable', models.BooleanField(default=False)),
|
|
('training_project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recipes', to='model_studio.trainingproject')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='modelcheckpoint',
|
|
name='recipe',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='checkpoints', to='model_studio.trainingrecipe'),
|
|
),
|
|
migrations.CreateModel(
|
|
name='TrainingRun',
|
|
fields=[
|
|
('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('status', models.CharField(choices=[('QUEUED', 'Queued'), ('STARTING', 'Starting'), ('RUNNING', 'Running'), ('CHECKPOINTING', 'Checkpointing'), ('SUCCEEDED', 'Succeeded'), ('FAILED', 'Failed'), ('OOM', 'Oom'), ('TIMEOUT', 'Timeout'), ('CANCELLED', 'Cancelled'), ('INTERRUPTED', 'Interrupted')], default='QUEUED', max_length=32)),
|
|
('command', models.JSONField(blank=True, default=list)),
|
|
('working_directory', models.TextField(blank=True)),
|
|
('environment_snapshot', models.JSONField(blank=True, default=dict)),
|
|
('host', models.CharField(blank=True, max_length=255)),
|
|
('gpu_device', models.CharField(blank=True, max_length=255)),
|
|
('allocated_memory_mb', models.PositiveIntegerField(blank=True, null=True)),
|
|
('started_at', models.DateTimeField(blank=True, null=True)),
|
|
('completed_at', models.DateTimeField(blank=True, null=True)),
|
|
('wall_seconds', models.FloatField(default=0)),
|
|
('exit_code', models.IntegerField(blank=True, null=True)),
|
|
('stdout_reference', models.TextField(blank=True)),
|
|
('stderr_reference', models.TextField(blank=True)),
|
|
('training_log_reference', models.TextField(blank=True)),
|
|
('peak_memory_mb', models.PositiveIntegerField(blank=True, null=True)),
|
|
('gpu_utilization', models.FloatField(blank=True, null=True)),
|
|
('failure_category', models.CharField(blank=True, max_length=80)),
|
|
('failure_details', models.TextField(blank=True)),
|
|
('resume_source', models.TextField(blank=True)),
|
|
('retry_count', models.PositiveIntegerField(default=0)),
|
|
('pid', models.IntegerField(blank=True, null=True)),
|
|
('heartbeat_at', models.DateTimeField(blank=True, null=True)),
|
|
('experiment', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='runs', to='model_studio.trainingexperiment')),
|
|
('input_checkpoint', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='input_runs', to='model_studio.modelcheckpoint')),
|
|
('output_checkpoint', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='producing_run', to='model_studio.modelcheckpoint')),
|
|
('recipe', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='runs', to='model_studio.trainingrecipe')),
|
|
],
|
|
options={
|
|
'abstract': False,
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name='modelcheckpoint',
|
|
name='training_run',
|
|
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='output_checkpoints', to='model_studio.trainingrun'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='datasetversion',
|
|
constraint=models.UniqueConstraint(fields=('dataset', 'version'), name='unique_model_studio_dataset_version'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='evaluationsuiteversion',
|
|
constraint=models.UniqueConstraint(fields=('suite', 'version'), name='unique_evaluation_suite_version'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='experimentdependency',
|
|
constraint=models.UniqueConstraint(fields=('experiment', 'depends_on'), name='unique_experiment_dependency'),
|
|
),
|
|
migrations.AddIndex(
|
|
model_name='trainingexperiment',
|
|
index=models.Index(fields=['training_project', 'fingerprint'], name='model_studi_trainin_53bef8_idx'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='dataset',
|
|
constraint=models.UniqueConstraint(fields=('training_project', 'name'), name='unique_model_studio_dataset'),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name='modelcheckpoint',
|
|
constraint=models.UniqueConstraint(fields=('training_project', 'reference'), name='unique_model_checkpoint_reference'),
|
|
),
|
|
]
|