You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(configure): more CodeRabbit feedback — observable assertions, LoRA guard, docs
Source fixes:
- LoRA warmup now slices a 1-row probe instead of forwarding the
full dataset (CodeRabbit: O(N) work just to shape-resolve).
- LoRAAdapterBase.CreateLoRALayer: throw InvalidOperationException
when both input and output dimensions are unresolved instead of
silently fabricating (outputSize*2, 1). The caller's
IsShapeResolved skip path now becomes the contract.
- AiModelBuilder.ConfiguredAgentAssistance: new internal accessor
so Bucket11 Agent test has a real assertion target (matches the
pattern PR #1361 established for reserved Configure* methods).
- AiModelResultOptions: PostprocessingPipeline + KnowledgeDistillationOptions
docs updated to include <value> tag and For-Beginners remarks,
matching the options-class golden pattern.
Test fixes:
- Bucket12_DistributedTests: removed the hard-coded
`SeenDDPModelDuringBuild => true` no-op assertion. Both DDP and
PipelineParallel tests now assert either result.Model implements
IShardedModel (when build completes) OR the build exception
originated from inside the distributed dispatch path (proving
the routing fired). Stored-but-not-consumed regressions on
ConfigureDistributedTraining / ConfigurePipelineParallelism would
fail one of those branches now.
- Bucket11 Agent test: added Assert.Same on the new
ConfiguredAgentAssistance accessor so xUnit doesn't pass a
no-Assert test silently.
- Bucket7 HPO recorder: short-circuit RandomSearchOptimizer.Optimize
override with a structurally-valid empty result instead of falling
through to base.Optimize. The previous fall-through ran a tiny
random search that retrained the model, adding latency and
flakiness sources unrelated to the wiring assertion.
62/62 (5 documented skips) still pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
// Downstream training on a stub backend may fail; the wrap
54
-
// happens earlier at AiModelBuilder.cs:2573 before training.
67
+
buildException=ex;
55
68
}
56
69
57
-
// Distributed wrapping mutates the local 'model' variable used
58
-
// by the optimizer. The wrapping is observable on the original
59
-
// builder's model field after BuildAsync — fetch via reflection
60
-
// and confirm SOME distributed wrapper class was created.
61
-
// (Even if result is null because training threw, the wrap path
62
-
// ran before that.)
63
-
// A stored-but-not-consumed regression would never construct
64
-
// any DDPModel and the test would fail.
65
-
Assert.True(SeenDDPModelDuringBuild,
66
-
"ConfigureDistributedTraining wired DDP backend but BuildSupervisedInternalAsync never reached the distributed-wrap switch at AiModelBuilder.cs:2595.");
70
+
// Whether build succeeded or failed downstream, the wrap-switch
71
+
// at L2595 runs synchronously BEFORE the optimizer. If it ran,
72
+
// we should observe either (a) result.Model implements
73
+
// IShardedModel, OR (b) the exception came from inside the
$"ConfigureDistributedTraining build failed, but the failure did not come from the distributed dispatch path. Stored-but-not-consumed regression likely. Stack trace excerpt: {trace.Substring(0,System.Math.Min(500,trace.Length))}");
91
+
}
67
92
}
68
93
69
-
privatestaticboolSeenDDPModelDuringBuild=>
70
-
// Reflection-free observability: the DistributedTraining
71
-
// namespace's static counter would be the right hook, but it
72
-
// doesn't exist; instead we assert on the simpler invariant
73
-
// that the wrap-switch is reachable for a DDP strategy with
74
-
// a non-null backend (the gate at AiModelBuilder.cs:2573 +
75
-
// 2595 unconditionally constructs DDPModel under those
76
-
// conditions). True since the gate is unconditional under the
77
-
// test's setup — the assertion is the test setup itself
78
-
// succeeding (no exception out of the wrap-switch block).
79
-
true;
80
-
81
94
/// <summary>
82
95
/// ConfigurePipelineParallelism — verifies the configured pipeline
83
96
/// strategy reaches the distributed wrap switch when paired with
@@ -99,25 +112,36 @@ public async Task ConfigurePipelineParallelism_WithDistributedBackend_RoutesToPi
$"ConfigurePipelineParallelism build failed, but the failure did not come from the pipeline-parallel dispatch path. Stored-but-not-consumed regression likely. Stack trace excerpt: {trace.Substring(0,System.Math.Min(500,trace.Length))}");
0 commit comments