doppler-gpu 0.4.8 → 0.4.10
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.
- package/CHANGELOG.md +29 -0
- package/README.md +62 -12
- package/models/catalog.json +21 -7
- package/package.json +25 -1
- package/src/config/conversion/qwen3/qwen-3-5-9b-f16-af32.json +474 -0
- package/src/config/conversion/qwen3/qwen-3-5-9b-q4k-ehaf16.json +509 -0
- package/src/config/kernels/backward-registry.json +13 -2
- package/src/config/kernels/kernel-ref-digests.js +8 -4
- package/src/config/kernels/registry.json +1035 -2677
- package/src/config/runtime/profiles/qwen-3-5-9b-metal-correctness.json +46 -0
- package/src/config/schema/training-metrics.schema.js +4 -0
- package/src/experimental/bridge/trainer-artifact-bridge.d.ts +161 -0
- package/src/experimental/bridge/trainer-artifact-bridge.js +573 -0
- package/src/experimental/training/attention-backward.js +123 -55
- package/src/experimental/training/autograd.js +101 -5
- package/src/experimental/training/clip.js +6 -1
- package/src/experimental/training/datasets/text-pairs.js +80 -8
- package/src/experimental/training/distillation/student-fixture.js +470 -114
- package/src/experimental/training/lora-pipeline.js +202 -27
- package/src/experimental/training/lora.js +10 -4
- package/src/experimental/training/optimizer.js +9 -1
- package/src/experimental/training/runner.js +18 -4
- package/src/experimental/training/workloads.js +11 -0
- package/src/gpu/device.js +100 -32
- package/src/gpu/kernels/backward/adam.js +6 -4
- package/src/gpu/kernels/backward/causal_conv1d_silu_backward.d.ts +24 -0
- package/src/gpu/kernels/backward/causal_conv1d_silu_backward.js +74 -0
- package/src/gpu/kernels/backward/causal_conv1d_silu_backward.wgsl +59 -0
- package/src/gpu/kernels/backward/cross_entropy_backward.wgsl +4 -0
- package/src/gpu/kernels/backward/gated_delta_recurrent_backward.d.ts +39 -0
- package/src/gpu/kernels/backward/gated_delta_recurrent_backward.js +124 -0
- package/src/gpu/kernels/backward/gated_delta_recurrent_backward.wgsl +177 -0
- package/src/gpu/kernels/backward/gated_rmsnorm_backward.d.ts +32 -0
- package/src/gpu/kernels/backward/gated_rmsnorm_backward.js +90 -0
- package/src/gpu/kernels/backward/gated_rmsnorm_backward.wgsl +86 -0
- package/src/gpu/kernels/backward/index.d.ts +3 -0
- package/src/gpu/kernels/backward/index.js +3 -0
- package/src/gpu/kernels/backward/matmul_backward.wgsl +6 -6
- package/src/gpu/kernels/backward/matmul_backward_f16w.wgsl +82 -0
- package/src/gpu/kernels/backward/rmsnorm_backward.js +26 -4
- package/src/gpu/kernels/backward/rmsnorm_backward.wgsl +6 -3
- package/src/gpu/kernels/backward/utils.d.ts +12 -2
- package/src/gpu/kernels/backward/utils.js +9 -2
- package/src/gpu/kernels/cast_f16_to_f32.wgsl +6 -2
- package/src/gpu/kernels/index.d.ts +5 -0
- package/src/gpu/kernels/index.js +5 -0
- package/src/gpu/kernels/matmul-selection.js +5 -0
- package/src/gpu/kernels/silu.d.ts +1 -0
- package/src/gpu/kernels/silu.js +19 -4
- package/src/inference/pipelines/text/embed.js +1 -1
- package/src/inference/pipelines/text/execution-v1.js +8 -2
- package/src/inference/pipelines/text/ffn/dense.js +2 -0
- package/src/inference/pipelines/text/generator.js +29 -0
- package/src/inference/pipelines/text/lora-apply.js +4 -4
- package/src/inference/pipelines/text/moe-cpu.js +1 -0
- package/src/inference/pipelines/text/moe-gpu.js +1 -0
- package/src/inference/tokenizers/bundled.js +105 -32
- package/src/rules/kernels/matmul.rules.json +1 -0
- package/src/tooling/node-converter.js +20 -5
- package/src/tooling/runtime-optimization.d.ts +109 -0
- package/src/tooling/runtime-optimization.js +872 -0
- package/src/tooling-experimental-exports.shared.d.ts +25 -0
- package/src/tooling-experimental-exports.shared.js +18 -0
- package/src/tooling-exports.shared.d.ts +19 -0
- package/src/tooling-exports.shared.js +11 -0
- package/src/version.js +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "profiles/qwen-3-5-9b-metal-correctness",
|
|
3
|
+
"name": "qwen-3-5-9b-metal-correctness",
|
|
4
|
+
"description": "Shared single-token decode contract for F16 and mixed-Q4_K correctness comparison on Apple Metal.",
|
|
5
|
+
"intent": "investigate",
|
|
6
|
+
"stability": "experimental",
|
|
7
|
+
"owner": "doppler-core",
|
|
8
|
+
"createdAtUtc": "2026-07-12T00:00:00Z",
|
|
9
|
+
"extends": "profiles/production",
|
|
10
|
+
"runtime": {
|
|
11
|
+
"inference": {
|
|
12
|
+
"batching": {
|
|
13
|
+
"batchSize": 1,
|
|
14
|
+
"maxTokens": 16,
|
|
15
|
+
"stopCheckMode": "batch",
|
|
16
|
+
"readbackInterval": 1,
|
|
17
|
+
"readbackMode": "sequential",
|
|
18
|
+
"ringTokens": 1,
|
|
19
|
+
"ringStop": 1,
|
|
20
|
+
"ringStaging": 1
|
|
21
|
+
},
|
|
22
|
+
"kvcache": {
|
|
23
|
+
"maxSeqLen": 256,
|
|
24
|
+
"kvDtype": "f16"
|
|
25
|
+
},
|
|
26
|
+
"session": {
|
|
27
|
+
"kvcache": {
|
|
28
|
+
"maxSeqLen": 256,
|
|
29
|
+
"kvDtype": "f16"
|
|
30
|
+
},
|
|
31
|
+
"decodeLoop": {
|
|
32
|
+
"batchSize": 1,
|
|
33
|
+
"stopCheckMode": "batch",
|
|
34
|
+
"readbackInterval": 1,
|
|
35
|
+
"readbackMode": "sequential",
|
|
36
|
+
"submitLatencyThresholdMs": null,
|
|
37
|
+
"maxBatchDecodeTokens": null,
|
|
38
|
+
"ringTokens": 1,
|
|
39
|
+
"ringStop": 1,
|
|
40
|
+
"ringStaging": 1,
|
|
41
|
+
"disableCommandBatching": false
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -103,6 +103,8 @@ export const DEFAULT_TRAINING_METRICS_REPORT = Object.freeze({
|
|
|
103
103
|
telemetry_alerts: [],
|
|
104
104
|
window_loss_avg: null,
|
|
105
105
|
window_step_time_ms_avg: null,
|
|
106
|
+
supervised_token_count: null,
|
|
107
|
+
ignored_target_count: null,
|
|
106
108
|
loss_kd: null,
|
|
107
109
|
loss_triplet: null,
|
|
108
110
|
distill_stage: null,
|
|
@@ -223,6 +225,8 @@ export function validateTrainingMetricsEntry(entry) {
|
|
|
223
225
|
}
|
|
224
226
|
assertNullableFiniteNumber(entry.window_loss_avg, 'window_loss_avg');
|
|
225
227
|
assertNullableFiniteNumber(entry.window_step_time_ms_avg, 'window_step_time_ms_avg');
|
|
228
|
+
assertOptionalIntegerGte(entry.supervised_token_count, 1, 'supervised_token_count');
|
|
229
|
+
assertOptionalIntegerGte(entry.ignored_target_count, 0, 'ignored_target_count');
|
|
226
230
|
assertNullableFiniteNumber(entry.loss_kd, 'loss_kd');
|
|
227
231
|
assertNullableFiniteNumber(entry.loss_triplet, 'loss_triplet');
|
|
228
232
|
assertNullableFiniteNumber(entry.distill_temperature, 'distill_temperature');
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
export declare const TRAINER_ARTIFACT_BRIDGE_SCHEMA_ID: 'doppler.trainer-artifact-bridge/v1';
|
|
2
|
+
export declare const TRAINER_ARTIFACT_IMPORT_PLAN_SCHEMA_ID: 'doppler.trainer-artifact-import-plan/v1';
|
|
3
|
+
export declare const TRAINER_ARTIFACT_PARITY_EVIDENCE_SCHEMA_ID: 'doppler.trainer-artifact-parity-evidence/v1';
|
|
4
|
+
export declare const TRAINER_ARTIFACT_PARITY_RECEIPT_SCHEMA_ID: 'doppler.trainer-artifact-parity-receipt/v1';
|
|
5
|
+
export declare const TRAINER_ARTIFACT_KIND_FULL_CHECKPOINT: 'full_checkpoint';
|
|
6
|
+
export declare const TRAINER_ARTIFACT_KIND_PEFT_ADAPTER: 'peft_adapter';
|
|
7
|
+
|
|
8
|
+
export declare const TRANSLATION_FULL_CHECKPOINT_PARITY_CHECKS: readonly string[];
|
|
9
|
+
export declare const COLUMBO_QWEN_ADAPTER_PARITY_CHECKS: readonly string[];
|
|
10
|
+
|
|
11
|
+
export interface TrainerArtifactFileIdentity {
|
|
12
|
+
id: string;
|
|
13
|
+
role: string;
|
|
14
|
+
repository: string;
|
|
15
|
+
rootPath: string;
|
|
16
|
+
path: string;
|
|
17
|
+
sha256: string;
|
|
18
|
+
bytes: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TrainerArtifactArchitecture {
|
|
22
|
+
architectures: string[];
|
|
23
|
+
modelType: string;
|
|
24
|
+
hiddenSize: number;
|
|
25
|
+
intermediateSize: number;
|
|
26
|
+
layers: number;
|
|
27
|
+
attentionHeads: number;
|
|
28
|
+
keyValueHeads: number;
|
|
29
|
+
headDim: number;
|
|
30
|
+
vocabularySize: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface TrainerArtifactBridgeDescriptor {
|
|
34
|
+
schema: typeof TRAINER_ARTIFACT_BRIDGE_SCHEMA_ID;
|
|
35
|
+
bridgeId: string;
|
|
36
|
+
sourceContractId: string;
|
|
37
|
+
artifact: {
|
|
38
|
+
kind: typeof TRAINER_ARTIFACT_KIND_FULL_CHECKPOINT | typeof TRAINER_ARTIFACT_KIND_PEFT_ADAPTER;
|
|
39
|
+
role: 'diagnostic_baseline' | 'diagnostic_candidate' | 'selected_candidate';
|
|
40
|
+
format: string;
|
|
41
|
+
repository: string;
|
|
42
|
+
rootPath: string;
|
|
43
|
+
files: TrainerArtifactFileIdentity[];
|
|
44
|
+
};
|
|
45
|
+
baseModel: {
|
|
46
|
+
modelId: string;
|
|
47
|
+
checkpointSha256: string;
|
|
48
|
+
tokenizer: {
|
|
49
|
+
files: TrainerArtifactFileIdentity[];
|
|
50
|
+
promptContract: TrainerArtifactFileIdentity;
|
|
51
|
+
};
|
|
52
|
+
architecture: TrainerArtifactArchitecture;
|
|
53
|
+
};
|
|
54
|
+
conversion: {
|
|
55
|
+
owner: string;
|
|
56
|
+
sourceArtifactSha256: string;
|
|
57
|
+
config: TrainerArtifactFileIdentity | null;
|
|
58
|
+
runtimeArtifact: Record<string, unknown> | null;
|
|
59
|
+
};
|
|
60
|
+
evaluation: {
|
|
61
|
+
populationRole: string;
|
|
62
|
+
files: TrainerArtifactFileIdentity[];
|
|
63
|
+
};
|
|
64
|
+
selection: {
|
|
65
|
+
authority: string;
|
|
66
|
+
status: 'not_selected' | 'selected';
|
|
67
|
+
receipt: string | null;
|
|
68
|
+
};
|
|
69
|
+
parity: {
|
|
70
|
+
profile: 'translation_full_checkpoint' | 'columbo_qwen_adapter';
|
|
71
|
+
requiredChecks: string[];
|
|
72
|
+
};
|
|
73
|
+
claimBoundary: string;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface TrainerArtifactVerificationReceipt {
|
|
77
|
+
schema: string;
|
|
78
|
+
ok: boolean;
|
|
79
|
+
bridgeId: string;
|
|
80
|
+
artifactIdentitySha256: string;
|
|
81
|
+
receiptHash: string;
|
|
82
|
+
[key: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface TrainerArtifactImportPlan {
|
|
86
|
+
schema: typeof TRAINER_ARTIFACT_IMPORT_PLAN_SCHEMA_ID;
|
|
87
|
+
bridgeId: string;
|
|
88
|
+
artifactKind: string;
|
|
89
|
+
entrypoint: 'resolveNodeSourceRuntimeBundle' | 'loadLoRAWeights';
|
|
90
|
+
source: Record<string, unknown>;
|
|
91
|
+
baseModel: TrainerArtifactBridgeDescriptor['baseModel'];
|
|
92
|
+
conversion: TrainerArtifactBridgeDescriptor['conversion'];
|
|
93
|
+
verificationReceiptHash: string | null;
|
|
94
|
+
admission: {
|
|
95
|
+
identityVerificationRequired: true;
|
|
96
|
+
parityExecutionAllowed: true;
|
|
97
|
+
candidateCompetitionAllowed: boolean;
|
|
98
|
+
promotionAllowed: false;
|
|
99
|
+
selectionAuthority: string;
|
|
100
|
+
selectionReceipt: string | null;
|
|
101
|
+
};
|
|
102
|
+
planHash: string;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface TrainerArtifactParityEvidenceCheck {
|
|
106
|
+
id: string;
|
|
107
|
+
status: 'pending' | 'pass' | 'fail';
|
|
108
|
+
evidenceHash: string | null;
|
|
109
|
+
artifactIdentitySha256: string;
|
|
110
|
+
upstreamDecision: 'pass' | 'block' | null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface TrainerArtifactParityEvidence {
|
|
114
|
+
schema: typeof TRAINER_ARTIFACT_PARITY_EVIDENCE_SCHEMA_ID;
|
|
115
|
+
bridgeId: string;
|
|
116
|
+
profile: string;
|
|
117
|
+
artifactIdentitySha256: string;
|
|
118
|
+
checks: TrainerArtifactParityEvidenceCheck[];
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export declare function normalizeGammaTrainerArtifactHandoff(
|
|
122
|
+
contract: Record<string, unknown>
|
|
123
|
+
): TrainerArtifactBridgeDescriptor;
|
|
124
|
+
|
|
125
|
+
export declare function validateTrainerArtifactBridgeDescriptor(
|
|
126
|
+
descriptor: unknown
|
|
127
|
+
): {
|
|
128
|
+
valid: boolean;
|
|
129
|
+
descriptor: TrainerArtifactBridgeDescriptor | null;
|
|
130
|
+
errors: string[];
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export declare function assertTrainerArtifactCandidateEntry(
|
|
134
|
+
descriptor: TrainerArtifactBridgeDescriptor
|
|
135
|
+
): TrainerArtifactBridgeDescriptor;
|
|
136
|
+
|
|
137
|
+
export declare function buildTrainerArtifactImportPlan(
|
|
138
|
+
descriptor: TrainerArtifactBridgeDescriptor,
|
|
139
|
+
verificationReceipt?: TrainerArtifactVerificationReceipt | null
|
|
140
|
+
): TrainerArtifactImportPlan;
|
|
141
|
+
|
|
142
|
+
export declare function buildTrainerArtifactParityTemplate(
|
|
143
|
+
descriptor: TrainerArtifactBridgeDescriptor,
|
|
144
|
+
verificationReceipt: TrainerArtifactVerificationReceipt
|
|
145
|
+
): TrainerArtifactParityEvidence;
|
|
146
|
+
|
|
147
|
+
export declare function verifyTrainerArtifactParityEvidence(
|
|
148
|
+
descriptor: TrainerArtifactBridgeDescriptor,
|
|
149
|
+
verificationReceipt: TrainerArtifactVerificationReceipt,
|
|
150
|
+
evidence: TrainerArtifactParityEvidence
|
|
151
|
+
): {
|
|
152
|
+
schema: typeof TRAINER_ARTIFACT_PARITY_RECEIPT_SCHEMA_ID;
|
|
153
|
+
bridgeId: string;
|
|
154
|
+
profile: string;
|
|
155
|
+
artifactIdentitySha256: string;
|
|
156
|
+
identityReceiptHash: string;
|
|
157
|
+
decision: 'pass' | 'block';
|
|
158
|
+
blockers: string[];
|
|
159
|
+
checkEvidenceHashes: Record<string, string | null>;
|
|
160
|
+
receiptHash: string;
|
|
161
|
+
};
|