|
1 | 1 | using AiDotNet.Agentic.Tools; |
| 2 | +using AiDotNet.Augmentation; |
2 | 3 | using AiDotNet.Clustering.Interfaces; |
| 4 | +using AiDotNet.NeuralRadianceFields.Data; |
3 | 5 | using AiDotNet.Configuration; |
4 | 6 | using AiDotNet.Deployment.Configuration; |
5 | 7 | using AiDotNet.DistributedTraining; |
@@ -913,12 +915,6 @@ IAiModelBuilder<T, TInput, TOutput> ConfigurePipelineParallelism( |
913 | 915 | /// </remarks> |
914 | 916 | IAiModelBuilder<T, TInput, TOutput> ConfigureAutoML(AutoMLOptions<T, TInput, TOutput>? options = null); |
915 | 917 |
|
916 | | - // NOTE: The advanced ConfigureAutoML(IAutoMLModel<T,TInput,TOutput>) overload is intentionally |
917 | | - // NOT part of this interface. Adding it would be a breaking change for every external |
918 | | - // IAiModelBuilder<T,TInput,TOutput> implementer. It remains a public method on the concrete |
919 | | - // AiModelBuilder<T,TInput,TOutput>, which is also what the generated YAML applier targets |
920 | | - // (it dispatches against the concrete builder type, not this interface). |
921 | | - |
922 | 918 | /// <summary> |
923 | 919 | /// Configures reinforcement learning options for training an RL agent. |
924 | 920 | /// </summary> |
@@ -1179,13 +1175,6 @@ IAiModelBuilder<T, TInput, TOutput> ConfigureKnowledgeDistillation( |
1179 | 1175 | /// <returns>The builder instance for method chaining.</returns> |
1180 | 1176 | IAiModelBuilder<T, TInput, TOutput> ConfigureTelemetry(TelemetryConfig? config = null); |
1181 | 1177 |
|
1182 | | - // ConfigureWeightStreaming intentionally lives on |
1183 | | - // IWeightStreamingCapableBuilder<T, TInput, TOutput> (declared at the |
1184 | | - // bottom of this file) instead of on IAiModelBuilder<T, TInput, TOutput>, |
1185 | | - // so adding it does not break external implementers of IAiModelBuilder. |
1186 | | - // The concrete AiModelBuilder<T, TInput, TOutput> implements both |
1187 | | - // interfaces, so existing fluent call sites continue to compile. |
1188 | | - |
1189 | 1178 | /// <summary> |
1190 | 1179 | /// Controls GPU backend diagnostic output visibility and routing. |
1191 | 1180 | /// Exposes all three controls from github.com/ooples/AiDotNet#1122: |
@@ -1450,6 +1439,80 @@ IAiModelBuilder<T, TInput, TOutput> ConfigureJitCompilation( |
1450 | 1439 | /// </remarks> |
1451 | 1440 | IAiModelBuilder<T, TInput, TOutput> ConfigureMixedPrecision(MixedPrecisionConfig? config = null); |
1452 | 1441 |
|
| 1442 | + /// <summary> |
| 1443 | + /// Configures training memory management — gradient checkpointing and activation pooling — so large models |
| 1444 | + /// (e.g. deep transformers) can train within a bounded activation-memory budget. |
| 1445 | + /// </summary> |
| 1446 | + /// <param name="configuration">The training-memory configuration (presets such as |
| 1447 | + /// <c>TrainingMemoryConfig.ForTransformers()</c> or <c>MemoryEfficient()</c>); <c>null</c> applies the defaults.</param> |
| 1448 | + /// <returns>The builder instance for method chaining.</returns> |
| 1449 | + /// <remarks> |
| 1450 | + /// <b>For Beginners:</b> deep models store the intermediate results of every layer during training so they |
| 1451 | + /// can compute gradients. Gradient checkpointing trades a little extra compute to recompute some of those |
| 1452 | + /// instead of holding them all in memory, which lets a bigger model fit on the same hardware. |
| 1453 | + /// </remarks> |
| 1454 | + IAiModelBuilder<T, TInput, TOutput> ConfigureMemoryManagement(Training.Memory.TrainingMemoryConfig? configuration = null); |
| 1455 | + |
| 1456 | + /// <summary> |
| 1457 | + /// Configures Float16/Int8 weight streaming so very large models can run without holding all weights in |
| 1458 | + /// memory at once. |
| 1459 | + /// </summary> |
| 1460 | + /// <param name="config">The weight-streaming configuration; <c>null</c> applies the defaults.</param> |
| 1461 | + /// <returns>The builder instance for method chaining.</returns> |
| 1462 | + IAiModelBuilder<T, TInput, TOutput> ConfigureWeightStreaming(WeightStreamingConfig? config = null); |
| 1463 | + |
| 1464 | + /// <summary> |
| 1465 | + /// Configures a runtime profiling pass over the build/inference path to capture timing and resource usage. |
| 1466 | + /// </summary> |
| 1467 | + /// <param name="config">The profiling configuration; <c>null</c> applies the defaults.</param> |
| 1468 | + /// <returns>The builder instance for method chaining.</returns> |
| 1469 | + IAiModelBuilder<T, TInput, TOutput> ConfigureProfiling(ProfilingConfig? config = null); |
| 1470 | + |
| 1471 | + /// <summary> |
| 1472 | + /// Configures model interpretability — feature attribution and explanations — on the built result. |
| 1473 | + /// </summary> |
| 1474 | + /// <param name="options">The interpretability options; <c>null</c> applies the defaults.</param> |
| 1475 | + /// <returns>The builder instance for method chaining.</returns> |
| 1476 | + /// <remarks> |
| 1477 | + /// <b>For Beginners:</b> interpretability tools tell you WHY the model made a prediction — which inputs |
| 1478 | + /// mattered most — instead of treating it as an opaque box. |
| 1479 | + /// </remarks> |
| 1480 | + IAiModelBuilder<T, TInput, TOutput> ConfigureInterpretability(InterpretabilityOptions? options = null); |
| 1481 | + |
| 1482 | + /// <summary> |
| 1483 | + /// Configures the preprocessing stage directly from a prebuilt |
| 1484 | + /// <see cref="PreprocessingPipeline{T,TInput,TInput}"/> (the overload for callers that already assembled one). |
| 1485 | + /// </summary> |
| 1486 | + /// <param name="pipeline">The preprocessing pipeline; <c>null</c> applies the defaults.</param> |
| 1487 | + /// <returns>The builder instance for method chaining.</returns> |
| 1488 | + IAiModelBuilder<T, TInput, TOutput> ConfigurePreprocessing(PreprocessingPipeline<T, TInput, TInput>? pipeline = null); |
| 1489 | + |
| 1490 | + /// <summary> |
| 1491 | + /// Configures training-time data augmentation with a type-parameterized augmentation configuration. |
| 1492 | + /// </summary> |
| 1493 | + /// <param name="config">The augmentation configuration.</param> |
| 1494 | + /// <returns>The builder instance for method chaining.</returns> |
| 1495 | + /// <remarks> |
| 1496 | + /// <b>For Beginners:</b> augmentation makes extra, slightly-varied copies of your training data (e.g. |
| 1497 | + /// jittered or shifted) so the model sees more variety and generalizes better. |
| 1498 | + /// </remarks> |
| 1499 | + IAiModelBuilder<T, TInput, TOutput> ConfigureAugmentation(AugmentationConfig<T, TInput>? config); |
| 1500 | + |
| 1501 | + /// <summary> |
| 1502 | + /// Configures AutoML with a caller-supplied AutoML model implementation (the advanced overload; the |
| 1503 | + /// <see cref="ConfigureAutoML(AutoMLOptions{T,TInput,TOutput})"/> overload takes a budget preset instead). |
| 1504 | + /// </summary> |
| 1505 | + /// <param name="autoMLModel">The AutoML model that drives architecture/hyperparameter search.</param> |
| 1506 | + /// <returns>The builder instance for method chaining.</returns> |
| 1507 | + IAiModelBuilder<T, TInput, TOutput> ConfigureAutoML(IAutoMLModel<T, TInput, TOutput> autoMLModel); |
| 1508 | + |
| 1509 | + /// <summary> |
| 1510 | + /// Configures the Neural Radiance Field image-view / pixel-batch data loader (the overload for NeRF pipelines). |
| 1511 | + /// </summary> |
| 1512 | + /// <param name="dataLoader">The image-view / pixel-batch data loader.</param> |
| 1513 | + /// <returns>The builder instance for method chaining.</returns> |
| 1514 | + IAiModelBuilder<T, TInput, TOutput> ConfigureDataLoader(IDataLoader<ImageView<T>, PixelBatch<T>> dataLoader); |
| 1515 | + |
1453 | 1516 | /// <summary> |
1454 | 1517 | /// Configures advanced reasoning capabilities for the model using Chain-of-Thought, Tree-of-Thoughts, and Self-Consistency strategies. |
1455 | 1518 | /// </summary> |
@@ -2323,28 +2386,3 @@ IAiModelBuilder<T, TInput, TOutput> ConfigureQueryStrategy( |
2323 | 2386 | IAiModelBuilder<T, TInput, TOutput> ConfigureSimilarityMetric(RetrievalAugmentedGeneration.VectorSearch.ISimilarityMetric<T> metric); |
2324 | 2387 |
|
2325 | 2388 | } |
2326 | | - |
2327 | | -/// <summary> |
2328 | | -/// Optional companion interface for builders that support PaLM-E-scale weight |
2329 | | -/// streaming. Kept separate from <see cref="IAiModelBuilder{T, TInput, TOutput}"/> |
2330 | | -/// so the introduction of <see cref="ConfigureWeightStreaming"/> does NOT |
2331 | | -/// break external implementers of <c>IAiModelBuilder</c>. Cast a builder to |
2332 | | -/// this interface (or use the concrete <see cref="AiModelBuilder{T, TInput, TOutput}"/>) |
2333 | | -/// to opt into the streaming control surface. |
2334 | | -/// </summary> |
2335 | | -public interface IWeightStreamingCapableBuilder<T, TInput, TOutput> : IAiModelBuilder<T, TInput, TOutput> |
2336 | | -{ |
2337 | | - /// <summary> |
2338 | | - /// Configures weight streaming behaviour for the model under |
2339 | | - /// construction. See the doc block on |
2340 | | - /// <see cref="AiDotNet.AiModelBuilder{T, TInput, TOutput}.ConfigureWeightStreaming"/> |
2341 | | - /// for the full behavioural contract — this declaration is the binding |
2342 | | - /// surface callers should invoke through when they want to remain |
2343 | | - /// abstract over the builder type. |
2344 | | - /// </summary> |
2345 | | - /// <param name="config">The streaming configuration. Pass null to |
2346 | | - /// reset to default auto-detect behaviour; pass a populated config |
2347 | | - /// to override.</param> |
2348 | | - /// <returns>The builder instance for method chaining.</returns> |
2349 | | - IAiModelBuilder<T, TInput, TOutput> ConfigureWeightStreaming(WeightStreamingConfig? config = null); |
2350 | | -} |
|
0 commit comments