refactor: remove per-layer JIT compiler system - #1099
Conversation
The per-layer JIT compiler has been superseded by the Lazy Tensor Graph Compiler in AiDotNet.Tensors v0.28.0, which operates at the engine level and provides automatic tape-based differentiation for all operations. Deleted: - src/JitCompiler/ (238 files) — IR, codegen, optimization passes - src/Configuration/JitCompilationConfig.cs - src/Interfaces/IJitCompilable.cs - All JitCompiler test directories and benchmark files Cleaned: - Removed IJitCompilable interface references from 38+ source files - Removed JitCompilation config from YAML loader, schema, and docs - Removed ConfiguredJitCompilation from AiModelBuilder - Updated RL agent tests to reflect JIT removal - Removed JitCompiler PR #770 tests from MergedPRBugFixTests - Removed JitCompilation assertions from YamlConfigTests Verified: Every trainable layer uses IEngine operations for automatic tape recording. Only RotaryPositionalEncodingLayer has no Engine ops but it is non-trainable (no parameters). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Removes the legacy per-layer JIT compiler system across the codebase and shifts remaining pathways to CPU/engine-based execution, aligning with the Lazy Tensor Graph Compiler approach.
Changes:
- Deleted the
src/JitCompiler/subsystem (IR, codegen, memory pooling, gradient ops, tests/benchmarks). - Removed
IJitCompilable<T>and eliminated JIT-related API/config surfaces (builder + YAML). - Updated remaining components (e.g., interpretability helper, neural network autodiff graph export) to work without JIT.
Reviewed changes
Copilot reviewed 257 out of 309 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Interpretability/Helpers/GPUExplainerHelper.cs | Removes GPU/JIT runtime wiring; forces CPU-only behavior. |
| src/Interfaces/ILayer.cs | Removes IJitCompilable<T> inheritance from layer contract. |
| src/Interfaces/ITextToSpeech.cs | Drops IJitCompilable<T> from model interface inheritance. |
| src/Interfaces/INeuralNetwork.cs | Drops IJitCompilable<T> from model interface inheritance. |
| src/Interfaces/IAiModelBuilder.cs | Removes ConfigureJitCompilation API from builder interface. |
| src/Configuration/YamlModelConfig.cs | Removes JIT compilation configuration section from YAML model config. |
| src/Configuration/YamlConfigApplier.cs | Stops applying JIT compilation config to the builder. |
| src/Autodiff/NeuralNetworkDerivatives.cs | Adjusts computation-graph export to work without IJitCompilable<T>. |
| src/Genetics/ModelIndividual.cs | Replaces JIT capability with constant “unsupported” behavior. |
| src/DistributedTraining/ShardedModelBase.cs | Replaces JIT capability with constant “unsupported” behavior. |
| src/AutoML/AutoMLModelBase.cs | Replaces JIT capability with constant “unsupported” behavior. |
| AiDotNetBenchmarkTests/GlobalUsings.cs | Removes AiDotNet.JitCompiler global using. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- GPUExplainerHelper: updated XML docs to reflect JIT removal — IsGPUEnabled/DeviceInfo now document they always return false/null and that GPU is at the Tensors engine level - NeuralNetworkDerivatives: removed dead BuildGraph method that used the deleted ExportComputationGraph - ModelIndividual: removed vestigial SupportsJitCompilation and ExportComputationGraph — not required by any interface Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughThis PR removes the entire JIT compilation subsystem and related APIs: IJitCompilable, JIT config, the JIT compiler and codegen, IR model and operations, SIMD/GPU kernels and runtimes, tensor pooling, workspace compilation, and builder/YAML wiring; multiple interfaces and model wrappers were updated to drop JIT surfaces. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 5 (Critical) | ⏱️ ~120+ minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/AiModelBuilder.cs (1)
2699-2719:⚠️ Potential issue | 🟡 MinorRemove stale JIT wording around the now-null result field.
Line 2718 hard-disables JIT output, but Line 2699 still documents JIT as part of the result flow. Please update nearby comments to reflect full JIT removal (and align the similar stale note around Lines 3190-3191).
✂️ Suggested cleanup
- // Return AiModelResult with CV results, agent data, JIT compilation, reasoning config, and training infrastructure + // Return AiModelResult with CV results, agent data, reasoning config, and training infrastructure🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/AiModelBuilder.cs` around lines 2699 - 2719, The code still mentions "JIT compilation" in comments around the AiModelBuilder options even though the JitCompiledFunction field is always set to null; update the comments and any stale notes (including the similar note near the block around Lines ~3190-3191) to remove or reword JIT/JIT compilation references and reflect that JIT output was removed. Locate the AiModelResultOptions construction in AiModelBuilder and any adjacent comment blocks referencing JIT or JitCompiledFunction and change them to describe the current state (e.g., no JIT support / JIT removed) or remove the JIT wording entirely so comments align with JitCompiledFunction = null.src/DistributedTraining/ShardedModelBase.cs (1)
489-509:⚠️ Potential issue | 🟡 MinorFix contradictory JIT documentation in sharded model API.
Line 505 and Line 509 hard-disable JIT, but the surrounding docs still claim support is delegated to
WrappedModel. Please update/remove that guidance to avoid incorrect IntelliSense and migration confusion.Proposed doc cleanup
- `#region` IJitCompilable Implementation + `#region` Former JIT Surface (Removed) @@ - /// <value>True if the wrapped model supports JIT compilation, false otherwise.</value> + /// <value>Always <c>false</c>. Per-layer JIT compilation has been removed.</value> @@ - /// Sharded models delegate JIT compilation support to their wrapped model. - /// JIT compilation is performed on the full model representation, not on individual shards. + /// Per-layer JIT compilation is no longer available. @@ - public virtual ComputationNode<T> ExportComputationGraph(List<ComputationNode<T>> inputNodes) + /// <summary> + /// Exporting computation graphs for JIT is no longer supported. + /// </summary> + /// <exception cref="NotSupportedException">Always thrown because JIT was removed.</exception> + public virtual ComputationNode<T> ExportComputationGraph(List<ComputationNode<T>> inputNodes)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/DistributedTraining/ShardedModelBase.cs` around lines 489 - 509, Update the XML docs on the ShardedModelBase API to remove the incorrect delegation claim to WrappedModel and clearly state that JIT compilation is not supported for sharded models: revise the summary/remarks of the SupportsJitCompilation property and the ExportComputationGraph method to explicitly say JIT compilation is disabled/unsupported for sharded models (do not say it is delegated to WrappedModel or that sharding allows JIT), and adjust the ExportComputationGraph remark/message to match the thrown NotSupportedException text so IntelliSense and migration guidance are consistent.src/AutoML/AutoMLModelBase.cs (1)
1162-1185:⚠️ Potential issue | 🟡 MinorUpdate stale JIT XML docs to match removed functionality.
Line 1181 always returns
falseand Line 1185 always throws, but the current XML docs still describe delegated JIT support and possible successful export. Please update the summaries/remarks/value text (and region label) to reflect permanent removal.Proposed doc cleanup
- `#region` IJitCompilable Implementation + `#region` Former JIT Surface (Removed) @@ - /// Gets whether this model currently supports JIT compilation. + /// Gets whether this model supports JIT compilation. @@ - /// <value>True if the best model found supports JIT compilation, false otherwise.</value> + /// <value>Always <c>false</c>. Per-layer JIT compilation has been removed.</value> @@ - /// AutoML models delegate JIT compilation support to their best model. - /// If no best model has been found yet, JIT compilation is not supported. + /// Per-layer JIT compilation is no longer available. @@ - public virtual ComputationNode<T> ExportComputationGraph(List<ComputationNode<T>> inputNodes) + /// <summary> + /// Exporting computation graphs for JIT is no longer supported. + /// </summary> + /// <exception cref="NotSupportedException">Always thrown because JIT was removed.</exception> + public virtual ComputationNode<T> ExportComputationGraph(List<ComputationNode<T>> inputNodes)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/AutoML/AutoMLModelBase.cs` around lines 1162 - 1185, The XML docs for SupportsJitCompilation and ExportComputationGraph are stale: update the summary, value and remarks (and any region label) to clearly state that JIT compilation was removed and is permanently unsupported (SupportsJitCompilation always returns false) and that ExportComputationGraph always throws NotSupportedException; replace any text about delegation or conditional support with a concise statement that JIT compilation is not supported by AutoMLModelBase and consumers should not expect ExportComputationGraph to work.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Interpretability/Helpers/GPUExplainerHelper.cs`:
- Around line 70-80: Validate the constructor parameter in GPUExplainerHelper:
ensure maxParallelism (and any code paths setting _maxParallelism, e.g., the
constructor that assigns _maxParallelism) is > 0; if null use
Environment.ProcessorCount, but if a value is supplied and it's <= 0 throw an
ArgumentOutOfRangeException (with a clear message) rather than accepting it, so
later uses (division by _maxParallelism and setting
ParallelOptions.MaxDegreeOfParallelism) won't fail with divide-by-zero or
invalid-parallelism errors.
- Around line 50-62: The public GPU surface (IsGPUEnabled, DeviceInfo) is
returning hardcoded placeholder values, making GPU branches in
GPUExplainerHelper unreachable; update GPUExplainerHelper by either
removing/marking obsolete the GPU-specific API and collapsing dead branches, or
implement real detection by querying the tensors engine capability in
CreateWithAutoDetect and returning true/actual device info from IsGPUEnabled and
DeviceInfo; locate and modify the properties IsGPUEnabled and DeviceInfo and the
factory method CreateWithAutoDetect (and related GPU branch methods) to either
delegate to the engine-level GPU capability API or to obsolete/remove the GPU
surface and clean up dead code paths.
---
Outside diff comments:
In `@src/AiModelBuilder.cs`:
- Around line 2699-2719: The code still mentions "JIT compilation" in comments
around the AiModelBuilder options even though the JitCompiledFunction field is
always set to null; update the comments and any stale notes (including the
similar note near the block around Lines ~3190-3191) to remove or reword JIT/JIT
compilation references and reflect that JIT output was removed. Locate the
AiModelResultOptions construction in AiModelBuilder and any adjacent comment
blocks referencing JIT or JitCompiledFunction and change them to describe the
current state (e.g., no JIT support / JIT removed) or remove the JIT wording
entirely so comments align with JitCompiledFunction = null.
In `@src/AutoML/AutoMLModelBase.cs`:
- Around line 1162-1185: The XML docs for SupportsJitCompilation and
ExportComputationGraph are stale: update the summary, value and remarks (and any
region label) to clearly state that JIT compilation was removed and is
permanently unsupported (SupportsJitCompilation always returns false) and that
ExportComputationGraph always throws NotSupportedException; replace any text
about delegation or conditional support with a concise statement that JIT
compilation is not supported by AutoMLModelBase and consumers should not expect
ExportComputationGraph to work.
In `@src/DistributedTraining/ShardedModelBase.cs`:
- Around line 489-509: Update the XML docs on the ShardedModelBase API to remove
the incorrect delegation claim to WrappedModel and clearly state that JIT
compilation is not supported for sharded models: revise the summary/remarks of
the SupportsJitCompilation property and the ExportComputationGraph method to
explicitly say JIT compilation is disabled/unsupported for sharded models (do
not say it is delegated to WrappedModel or that sharding allows JIT), and adjust
the ExportComputationGraph remark/message to match the thrown
NotSupportedException text so IntelliSense and migration guidance are
consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6fc9455e-f105-4438-9e08-43a2364efc99
📒 Files selected for processing (300)
AiDotNetBenchmarkTests/GlobalUsings.cssrc/AdversarialRobustness/Defenses/AdversarialTraining.cssrc/AiModelBuilder.cssrc/AutoML/AutoMLModelBase.cssrc/Autodiff/NeuralNetworkDerivatives.cssrc/Clustering/Base/ClusteringBase.cssrc/Configuration/JitCompilationConfig.cssrc/Configuration/YamlConfigApplier.cssrc/Configuration/YamlDocsGenerator.cssrc/Configuration/YamlJsonSchema.cssrc/Configuration/YamlModelConfig.cssrc/Diffusion/NoisePredictors/UNetNoisePredictor.cssrc/DistributedTraining/ShardedModelBase.cssrc/Genetics/ModelIndividual.cssrc/Helpers/InterfaceGuard.cssrc/Interfaces/IAiModelBuilder.cssrc/Interfaces/IAudioEventDetector.cssrc/Interfaces/IAudioGenerator.cssrc/Interfaces/ICausalModel.cssrc/Interfaces/IDiffusionModel.cssrc/Interfaces/IGenreClassifier.cssrc/Interfaces/IJitCompilable.cssrc/Interfaces/ILayer.cssrc/Interfaces/IMultiLabelClassifier.cssrc/Interfaces/IMusicSourceSeparator.cssrc/Interfaces/INeuralNetwork.cssrc/Interfaces/INoisePredictor.cssrc/Interfaces/IOnlineLearningModel.cssrc/Interfaces/IRLAgent.cssrc/Interfaces/ISceneClassifier.cssrc/Interfaces/ISegmentationModel.cssrc/Interfaces/ISpeakerDiarizer.cssrc/Interfaces/ISpeakerVerifier.cssrc/Interfaces/ISpeechRecognizer.cssrc/Interfaces/ITextToSpeech.cssrc/Interfaces/IVAEModel.cssrc/Interpretability/Helpers/GPUExplainerHelper.cssrc/JitCompiler/CacheStats.cssrc/JitCompiler/CodeGen/CodeGenerator.cssrc/JitCompiler/CodeGen/FP16Kernels.cssrc/JitCompiler/CodeGen/GPUCodeGenerator.cssrc/JitCompiler/CodeGen/GPUKernelLibrary.cssrc/JitCompiler/CodeGen/GradientOps.cssrc/JitCompiler/CodeGen/IGPUKernelHandle.cssrc/JitCompiler/CodeGen/IGPUMemoryHandle.cssrc/JitCompiler/CodeGen/IGPURuntime.cssrc/JitCompiler/CodeGen/MockGPURuntime.cssrc/JitCompiler/CodeGen/RecurrentOps.cssrc/JitCompiler/CodeGen/SIMDCapabilities.cssrc/JitCompiler/CodeGen/SIMDOptimizer.cssrc/JitCompiler/CodeGen/SIMDStats.cssrc/JitCompiler/CodeGen/VectorHelper.cssrc/JitCompiler/CodeGen/WorkspaceCodeGenerator.cssrc/JitCompiler/CompilationStats.cssrc/JitCompiler/HybridCompilationResult.cssrc/JitCompiler/IR/IFusableActivation.cssrc/JitCompiler/IR/IRGraph.cssrc/JitCompiler/IR/IROp.cssrc/JitCompiler/IR/IRType.cssrc/JitCompiler/IR/Operations/AbsOp.cssrc/JitCompiler/IR/Operations/AddOp.cssrc/JitCompiler/IR/Operations/AffineGridOp.cssrc/JitCompiler/IR/Operations/ApplyActivationOp.cssrc/JitCompiler/IR/Operations/AttentionOp.cssrc/JitCompiler/IR/Operations/AvgPool2DOp.cssrc/JitCompiler/IR/Operations/BackwardOp.cssrc/JitCompiler/IR/Operations/BatchNormOp.cssrc/JitCompiler/IR/Operations/BentIdentityOp.cssrc/JitCompiler/IR/Operations/CELUOp.cssrc/JitCompiler/IR/Operations/ComplexMatMulOp.cssrc/JitCompiler/IR/Operations/ComplexMultiplyOp.cssrc/JitCompiler/IR/Operations/ConcatOp.cssrc/JitCompiler/IR/Operations/ConstantOp.cssrc/JitCompiler/IR/Operations/Conv2DOp.cssrc/JitCompiler/IR/Operations/ConvTranspose2DOp.cssrc/JitCompiler/IR/Operations/CropOp.cssrc/JitCompiler/IR/Operations/DepthwiseConv2DOp.cssrc/JitCompiler/IR/Operations/DifferentiableApproximationOps.cssrc/JitCompiler/IR/Operations/DilatedConv2DOp.cssrc/JitCompiler/IR/Operations/DivideOp.cssrc/JitCompiler/IR/Operations/DropoutOp.cssrc/JitCompiler/IR/Operations/ELUOp.cssrc/JitCompiler/IR/Operations/ElementwiseMultiplyOp.cssrc/JitCompiler/IR/Operations/EmbeddingOp.cssrc/JitCompiler/IR/Operations/ExpOp.cssrc/JitCompiler/IR/Operations/FusedAddGroupNormOp.cssrc/JitCompiler/IR/Operations/FusedAddLayerNormOp.cssrc/JitCompiler/IR/Operations/FusedAddReLUOp.cssrc/JitCompiler/IR/Operations/FusedAttentionOp.cssrc/JitCompiler/IR/Operations/FusedBatchNormActivationOp.cssrc/JitCompiler/IR/Operations/FusedBiasActivationOp.cssrc/JitCompiler/IR/Operations/FusedConv2DBiasActivationOp.cssrc/JitCompiler/IR/Operations/FusedConvBatchNormActivationOp.cssrc/JitCompiler/IR/Operations/FusedConvBatchNormOp.cssrc/JitCompiler/IR/Operations/FusedDenseLayerOp.cssrc/JitCompiler/IR/Operations/FusedElementwiseActivationOp.cssrc/JitCompiler/IR/Operations/FusedElementwiseChainOp.cssrc/JitCompiler/IR/Operations/FusedGELUOp.cssrc/JitCompiler/IR/Operations/FusedGroupNormActivationConv2DOp.cssrc/JitCompiler/IR/Operations/FusedGroupNormActivationOp.cssrc/JitCompiler/IR/Operations/FusedLayerNormAddOp.cssrc/JitCompiler/IR/Operations/FusedLinearActivationOp.cssrc/JitCompiler/IR/Operations/FusedLinearOp.cssrc/JitCompiler/IR/Operations/FusedLinearReLUOp.cssrc/JitCompiler/IR/Operations/FusedMatMulAddOp.cssrc/JitCompiler/IR/Operations/FusedMultiHeadAttentionOp.cssrc/JitCompiler/IR/Operations/FusedResidualBlockOp.cssrc/JitCompiler/IR/Operations/FusedSwishOp.cssrc/JitCompiler/IR/Operations/GELUOp.cssrc/JitCompiler/IR/Operations/GRUCellOp.cssrc/JitCompiler/IR/Operations/GaussianOp.cssrc/JitCompiler/IR/Operations/GeometricProductOp.cssrc/JitCompiler/IR/Operations/GradAccumulateOp.cssrc/JitCompiler/IR/Operations/GradAddOp.cssrc/JitCompiler/IR/Operations/GradAttentionOp.cssrc/JitCompiler/IR/Operations/GradAvgPool2DOp.cssrc/JitCompiler/IR/Operations/GradBatchNormOp.cssrc/JitCompiler/IR/Operations/GradBentIdentityOp.cssrc/JitCompiler/IR/Operations/GradBroadcastOp.cssrc/JitCompiler/IR/Operations/GradCELUOp.cssrc/JitCompiler/IR/Operations/GradConcatOp.cssrc/JitCompiler/IR/Operations/GradConv2DOp.cssrc/JitCompiler/IR/Operations/GradConvTranspose2DOp.cssrc/JitCompiler/IR/Operations/GradCropOp.cssrc/JitCompiler/IR/Operations/GradDepthwiseConv2DOp.cssrc/JitCompiler/IR/Operations/GradDivideOp.cssrc/JitCompiler/IR/Operations/GradDropoutOp.cssrc/JitCompiler/IR/Operations/GradELUOp.cssrc/JitCompiler/IR/Operations/GradElementwiseMultiplyOp.cssrc/JitCompiler/IR/Operations/GradEmbeddingOp.cssrc/JitCompiler/IR/Operations/GradExpOp.cssrc/JitCompiler/IR/Operations/GradGELUOp.cssrc/JitCompiler/IR/Operations/GradGRUCellOp.cssrc/JitCompiler/IR/Operations/GradGRUSequenceOp.cssrc/JitCompiler/IR/Operations/GradGatherOp.cssrc/JitCompiler/IR/Operations/GradGaussianOp.cssrc/JitCompiler/IR/Operations/GradGeometricProductOp.cssrc/JitCompiler/IR/Operations/GradHardSigmoidOp.cssrc/JitCompiler/IR/Operations/GradHardTanhOp.cssrc/JitCompiler/IR/Operations/GradISRUOp.cssrc/JitCompiler/IR/Operations/GradLSTMCellInputOp.cssrc/JitCompiler/IR/Operations/GradLSTMSequenceOp.cssrc/JitCompiler/IR/Operations/GradLayerNormOp.cssrc/JitCompiler/IR/Operations/GradLeakyReLUOp.cssrc/JitCompiler/IR/Operations/GradLiSHTOp.cssrc/JitCompiler/IR/Operations/GradLogOp.cssrc/JitCompiler/IR/Operations/GradLogSoftmaxOp.cssrc/JitCompiler/IR/Operations/GradMatMulLeftOp.cssrc/JitCompiler/IR/Operations/GradMatMulRightOp.cssrc/JitCompiler/IR/Operations/GradMaxPool2DOp.cssrc/JitCompiler/IR/Operations/GradMeanOp.cssrc/JitCompiler/IR/Operations/GradMishOp.cssrc/JitCompiler/IR/Operations/GradMobiusAddOp.cssrc/JitCompiler/IR/Operations/GradMultiHeadAttentionOp.cssrc/JitCompiler/IR/Operations/GradOctonionMultiplyOp.cssrc/JitCompiler/IR/Operations/GradPReLUOp.cssrc/JitCompiler/IR/Operations/GradPadOp.cssrc/JitCompiler/IR/Operations/GradPoincareExpMapOp.cssrc/JitCompiler/IR/Operations/GradPowerOp.cssrc/JitCompiler/IR/Operations/GradRReLUOp.cssrc/JitCompiler/IR/Operations/GradReLUOp.cssrc/JitCompiler/IR/Operations/GradReshapeOp.cssrc/JitCompiler/IR/Operations/GradSELUOp.cssrc/JitCompiler/IR/Operations/GradScaledTanhOp.cssrc/JitCompiler/IR/Operations/GradSigmoidOp.cssrc/JitCompiler/IR/Operations/GradSliceOp.cssrc/JitCompiler/IR/Operations/GradSoftPlusOp.cssrc/JitCompiler/IR/Operations/GradSoftSignOp.cssrc/JitCompiler/IR/Operations/GradSoftmaxOp.cssrc/JitCompiler/IR/Operations/GradSpMMOp.cssrc/JitCompiler/IR/Operations/GradSpMVOp.cssrc/JitCompiler/IR/Operations/GradSparsemaxOp.cssrc/JitCompiler/IR/Operations/GradSplitOp.cssrc/JitCompiler/IR/Operations/GradSqrtOp.cssrc/JitCompiler/IR/Operations/GradSubtractOp.cssrc/JitCompiler/IR/Operations/GradSumOp.cssrc/JitCompiler/IR/Operations/GradSwishOp.cssrc/JitCompiler/IR/Operations/GradTanhOp.cssrc/JitCompiler/IR/Operations/GradThresholdedReLUOp.cssrc/JitCompiler/IR/Operations/GradTransposeOp.cssrc/JitCompiler/IR/Operations/GradUpsampleOp.cssrc/JitCompiler/IR/Operations/GraphConvOp.cssrc/JitCompiler/IR/Operations/GridSampleOp.cssrc/JitCompiler/IR/Operations/GroupNormOp.cssrc/JitCompiler/IR/Operations/HardSigmoidOp.cssrc/JitCompiler/IR/Operations/HardTanhOp.cssrc/JitCompiler/IR/Operations/HierarchicalSoftmaxOp.cssrc/JitCompiler/IR/Operations/ISRUOp.cssrc/JitCompiler/IR/Operations/LSTMCellOp.cssrc/JitCompiler/IR/Operations/LayerNormOp.cssrc/JitCompiler/IR/Operations/LeakyReLUOp.cssrc/JitCompiler/IR/Operations/LiSHTOp.cssrc/JitCompiler/IR/Operations/LocallyConnectedConv2DOp.cssrc/JitCompiler/IR/Operations/LogOp.cssrc/JitCompiler/IR/Operations/LogSoftmaxOp.cssrc/JitCompiler/IR/Operations/LogSoftminOp.cssrc/JitCompiler/IR/Operations/MatMulOp.cssrc/JitCompiler/IR/Operations/MaxPool2DOp.cssrc/JitCompiler/IR/Operations/MaxoutOp.cssrc/JitCompiler/IR/Operations/MeanOp.cssrc/JitCompiler/IR/Operations/MishOp.cssrc/JitCompiler/IR/Operations/MobiusAddOp.cssrc/JitCompiler/IR/Operations/MultiHeadAttentionOp.cssrc/JitCompiler/IR/Operations/NegateOp.cssrc/JitCompiler/IR/Operations/NormOp.cssrc/JitCompiler/IR/Operations/OctonionMatMulOp.cssrc/JitCompiler/IR/Operations/OctonionMultiplyOp.cssrc/JitCompiler/IR/Operations/PReLUOp.cssrc/JitCompiler/IR/Operations/PadOp.cssrc/JitCompiler/IR/Operations/PixelShuffleOp.cssrc/JitCompiler/IR/Operations/PoincareExpMapOp.cssrc/JitCompiler/IR/Operations/PoincareLogMapOp.cssrc/JitCompiler/IR/Operations/PowerOp.cssrc/JitCompiler/IR/Operations/RBFKernelOp.cssrc/JitCompiler/IR/Operations/RReLUOp.cssrc/JitCompiler/IR/Operations/ReLUOp.cssrc/JitCompiler/IR/Operations/ReduceLogVarianceOp.cssrc/JitCompiler/IR/Operations/ReduceMaxOp.cssrc/JitCompiler/IR/Operations/ReduceMeanOp.cssrc/JitCompiler/IR/Operations/ReshapeOp.cssrc/JitCompiler/IR/Operations/SELUOp.cssrc/JitCompiler/IR/Operations/SQRBFOp.cssrc/JitCompiler/IR/Operations/ScalarConstantOp.cssrc/JitCompiler/IR/Operations/ScaledDotProductAttentionOp.cssrc/JitCompiler/IR/Operations/ScaledTanhOp.cssrc/JitCompiler/IR/Operations/SigmoidOp.cssrc/JitCompiler/IR/Operations/SignOp.cssrc/JitCompiler/IR/Operations/SliceOp.cssrc/JitCompiler/IR/Operations/SoftPlusOp.cssrc/JitCompiler/IR/Operations/SoftSignOp.cssrc/JitCompiler/IR/Operations/SoftmaxOp.cssrc/JitCompiler/IR/Operations/SoftminOp.cssrc/JitCompiler/IR/Operations/SpMMOp.cssrc/JitCompiler/IR/Operations/SpMVOp.cssrc/JitCompiler/IR/Operations/SparsemaxOp.cssrc/JitCompiler/IR/Operations/SphericalSoftmaxOp.cssrc/JitCompiler/IR/Operations/SplitOp.cssrc/JitCompiler/IR/Operations/SqrtOp.cssrc/JitCompiler/IR/Operations/SquareOp.cssrc/JitCompiler/IR/Operations/SquashOp.cssrc/JitCompiler/IR/Operations/SubtractOp.cssrc/JitCompiler/IR/Operations/SumOp.cssrc/JitCompiler/IR/Operations/SwishOp.cssrc/JitCompiler/IR/Operations/TanhOp.cssrc/JitCompiler/IR/Operations/TaylorSoftmaxOp.cssrc/JitCompiler/IR/Operations/ThresholdedReLUOp.cssrc/JitCompiler/IR/Operations/TransposeOp.cssrc/JitCompiler/IR/Operations/UpsampleOp.cssrc/JitCompiler/IR/Operations/VectorizedOps.cssrc/JitCompiler/IR/Operations/WedgeProductOp.cssrc/JitCompiler/IR/TensorShape.cssrc/JitCompiler/IRBuilder.cssrc/JitCompiler/JitCompatibilityResult.cssrc/JitCompiler/JitCompiler.cssrc/JitCompiler/JitCompilerOptions.cssrc/JitCompiler/Memory/TensorPool.cssrc/JitCompiler/Memory/TensorPoolStats.cssrc/JitCompiler/Memory/TensorRental.cssrc/JitCompiler/Optimizations/AdaptiveFusionPass.cssrc/JitCompiler/Optimizations/AutoTuningPass.cssrc/JitCompiler/Optimizations/ConstantFoldingPass.cssrc/JitCompiler/Optimizations/DeadCodeEliminationPass.cssrc/JitCompiler/Optimizations/IOptimizationPass.cssrc/JitCompiler/Optimizations/LoopUnrollingPass.cssrc/JitCompiler/Optimizations/MemoryPlanningPass.cssrc/JitCompiler/Optimizations/OperationFusionPass.cssrc/JitCompiler/Optimizations/OperatorReorderingPass.cssrc/JitCompiler/Optimizations/TileSchedulingPass.cssrc/JitCompiler/Optimizations/VectorizationPass.cssrc/JitCompiler/Optimizations/VectorizationStats.cssrc/JitCompiler/README.mdsrc/JitCompiler/Runtime/UnrolledOps.cssrc/JitCompiler/Runtime/VectorizedOps.cssrc/JitCompiler/Testing/GradientVerification.cssrc/JitCompiler/Testing/GradientVerificationExtensions.cssrc/JitCompiler/UnsupportedOperationInfo.cssrc/KnowledgeDistillation/TeacherModelBase.cssrc/KnowledgeDistillation/Teachers/OnlineTeacherModel.cssrc/KnowledgeDistillation/Teachers/PretrainedTeacherModel.cssrc/KnowledgeDistillation/Teachers/QuantizedTeacherModel.cssrc/KnowledgeDistillation/Teachers/SelfTeacherModel.cssrc/KnowledgeDistillation/Teachers/TransformerTeacherModel.cssrc/Models/ModelBase.cssrc/Models/ModelWrapperBase.cssrc/Models/Results/AiModelResult.cssrc/NeuralNetworks/NeuralNetworkBase.cssrc/NeuralNetworks/SyntheticData/SyntheticTabularGeneratorBase.cssrc/NeuralNetworks/SyntheticData/TapeLayerBridge.cssrc/Regression/NonLinearRegressionBase.cssrc/Regression/RegressionBase.cssrc/ReinforcementLearning/Agents/DeepReinforcementLearningAgentBase.cstests/AiDotNet.Tests/Benchmarks/JitCompilerBenchmarks.cstests/AiDotNet.Tests/IntegrationTests/Configuration/YamlConfigTests.cstests/AiDotNet.Tests/IntegrationTests/JitCompiler/JitCompilerDeepMathIntegrationTests.cstests/AiDotNet.Tests/IntegrationTests/JitCompiler/JitCompilerExtendedIntegrationTests.cstests/AiDotNet.Tests/IntegrationTests/JitCompiler/JitCompilerIntegrationTests.cstests/AiDotNet.Tests/IntegrationTests/JitCompiler/WorkspaceCompilationTests.cstests/AiDotNet.Tests/IntegrationTests/ReinforcementLearning/BaseClassesIntegrationTests.cstests/AiDotNet.Tests/JitCompiler/JitCompilerOperationsTests.cstests/AiDotNet.Tests/MergedPRBugFixTests.cs
💤 Files with no reviewable changes (232)
- src/JitCompiler/IR/Operations/GradSqrtOp.cs
- AiDotNetBenchmarkTests/GlobalUsings.cs
- src/AdversarialRobustness/Defenses/AdversarialTraining.cs
- src/Autodiff/NeuralNetworkDerivatives.cs
- src/Configuration/YamlConfigApplier.cs
- src/Configuration/YamlDocsGenerator.cs
- src/Configuration/YamlJsonSchema.cs
- src/Configuration/YamlModelConfig.cs
- src/Helpers/InterfaceGuard.cs
- src/JitCompiler/CacheStats.cs
- src/JitCompiler/CodeGen/IGPUKernelHandle.cs
- src/JitCompiler/CodeGen/IGPUMemoryHandle.cs
- src/JitCompiler/IR/IFusableActivation.cs
- src/JitCompiler/IR/IRType.cs
- src/JitCompiler/IR/Operations/AbsOp.cs
- src/JitCompiler/IR/Operations/AddOp.cs
- src/JitCompiler/IR/Operations/AffineGridOp.cs
- src/JitCompiler/IR/Operations/ApplyActivationOp.cs
- src/JitCompiler/IR/Operations/AttentionOp.cs
- src/JitCompiler/IR/Operations/AvgPool2DOp.cs
- src/JitCompiler/IR/Operations/BackwardOp.cs
- src/JitCompiler/IR/Operations/BatchNormOp.cs
- src/JitCompiler/IR/Operations/BentIdentityOp.cs
- src/JitCompiler/IR/Operations/CELUOp.cs
- src/JitCompiler/IR/Operations/ComplexMatMulOp.cs
- src/JitCompiler/IR/Operations/ComplexMultiplyOp.cs
- src/JitCompiler/IR/Operations/ConcatOp.cs
- src/JitCompiler/IR/Operations/Conv2DOp.cs
- src/JitCompiler/IR/Operations/ConvTranspose2DOp.cs
- src/JitCompiler/IR/Operations/CropOp.cs
- src/JitCompiler/IR/Operations/DepthwiseConv2DOp.cs
- src/JitCompiler/IR/Operations/DilatedConv2DOp.cs
- src/JitCompiler/IR/Operations/DivideOp.cs
- src/JitCompiler/IR/Operations/DropoutOp.cs
- src/JitCompiler/IR/Operations/ELUOp.cs
- src/JitCompiler/IR/Operations/ElementwiseMultiplyOp.cs
- src/JitCompiler/IR/Operations/EmbeddingOp.cs
- src/JitCompiler/IR/Operations/ExpOp.cs
- src/JitCompiler/IR/Operations/FusedAddGroupNormOp.cs
- src/JitCompiler/IR/Operations/FusedAddLayerNormOp.cs
- src/JitCompiler/IR/Operations/FusedAttentionOp.cs
- src/JitCompiler/IR/Operations/FusedBatchNormActivationOp.cs
- src/JitCompiler/IR/Operations/FusedBiasActivationOp.cs
- src/JitCompiler/IR/Operations/FusedConv2DBiasActivationOp.cs
- src/JitCompiler/IR/Operations/FusedConvBatchNormActivationOp.cs
- src/JitCompiler/IR/Operations/FusedDenseLayerOp.cs
- src/JitCompiler/IR/Operations/FusedElementwiseActivationOp.cs
- src/JitCompiler/IR/Operations/FusedGELUOp.cs
- src/JitCompiler/IR/Operations/FusedGroupNormActivationConv2DOp.cs
- src/JitCompiler/IR/Operations/FusedGroupNormActivationOp.cs
- src/JitCompiler/IR/Operations/FusedLayerNormAddOp.cs
- src/JitCompiler/IR/Operations/FusedLinearActivationOp.cs
- src/JitCompiler/IR/Operations/FusedLinearOp.cs
- src/JitCompiler/IR/Operations/FusedLinearReLUOp.cs
- src/JitCompiler/IR/Operations/FusedMatMulAddOp.cs
- src/JitCompiler/IR/Operations/FusedMultiHeadAttentionOp.cs
- src/JitCompiler/IR/Operations/FusedSwishOp.cs
- src/JitCompiler/IR/Operations/GELUOp.cs
- src/JitCompiler/IR/Operations/GRUCellOp.cs
- src/JitCompiler/IR/Operations/GaussianOp.cs
- src/JitCompiler/IR/Operations/GeometricProductOp.cs
- src/JitCompiler/IR/Operations/GradAccumulateOp.cs
- src/JitCompiler/IR/Operations/GradAddOp.cs
- src/JitCompiler/IR/Operations/GradAttentionOp.cs
- src/JitCompiler/IR/Operations/GradAvgPool2DOp.cs
- src/JitCompiler/IR/Operations/GradBatchNormOp.cs
- src/JitCompiler/IR/Operations/GradBentIdentityOp.cs
- src/JitCompiler/IR/Operations/GradBroadcastOp.cs
- src/JitCompiler/IR/Operations/GradCELUOp.cs
- src/JitCompiler/IR/Operations/GradConcatOp.cs
- src/JitCompiler/IR/Operations/GradCropOp.cs
- src/JitCompiler/IR/Operations/GradDepthwiseConv2DOp.cs
- src/JitCompiler/IR/Operations/GradDivideOp.cs
- src/JitCompiler/IR/Operations/GradDropoutOp.cs
- src/JitCompiler/IR/Operations/GradELUOp.cs
- src/JitCompiler/IR/Operations/GradElementwiseMultiplyOp.cs
- src/JitCompiler/IR/Operations/GradEmbeddingOp.cs
- src/JitCompiler/IR/Operations/GradExpOp.cs
- src/JitCompiler/IR/Operations/GradGELUOp.cs
- src/JitCompiler/IR/Operations/GradGRUCellOp.cs
- src/JitCompiler/IR/Operations/GradGRUSequenceOp.cs
- src/JitCompiler/IR/Operations/GradGatherOp.cs
- src/JitCompiler/IR/Operations/GradGaussianOp.cs
- src/JitCompiler/IR/Operations/GradGeometricProductOp.cs
- src/JitCompiler/IR/Operations/GradHardSigmoidOp.cs
- src/JitCompiler/IR/Operations/GradHardTanhOp.cs
- src/JitCompiler/IR/Operations/GradISRUOp.cs
- src/JitCompiler/IR/Operations/GradLSTMCellInputOp.cs
- src/JitCompiler/IR/Operations/GradLSTMSequenceOp.cs
- src/JitCompiler/IR/Operations/GradLayerNormOp.cs
- src/JitCompiler/IR/Operations/GradLeakyReLUOp.cs
- src/JitCompiler/IR/Operations/GradLogOp.cs
- src/JitCompiler/IR/Operations/GradLogSoftmaxOp.cs
- src/JitCompiler/IR/Operations/GradMatMulLeftOp.cs
- src/JitCompiler/IR/Operations/GradMatMulRightOp.cs
- src/JitCompiler/IR/Operations/GradMaxPool2DOp.cs
- src/JitCompiler/IR/Operations/GradMeanOp.cs
- src/JitCompiler/IR/Operations/GradMishOp.cs
- src/JitCompiler/IR/Operations/GradMobiusAddOp.cs
- src/JitCompiler/IR/Operations/GradMultiHeadAttentionOp.cs
- src/JitCompiler/IR/Operations/GradOctonionMultiplyOp.cs
- src/JitCompiler/IR/Operations/GradPReLUOp.cs
- src/JitCompiler/IR/Operations/GradPoincareExpMapOp.cs
- src/JitCompiler/IR/Operations/GradPowerOp.cs
- src/JitCompiler/IR/Operations/GradReLUOp.cs
- src/JitCompiler/IR/Operations/GradReshapeOp.cs
- src/JitCompiler/IR/Operations/GradSELUOp.cs
- src/JitCompiler/IR/Operations/GradScaledTanhOp.cs
- src/JitCompiler/IR/Operations/GradSigmoidOp.cs
- src/JitCompiler/IR/Operations/GradSliceOp.cs
- src/JitCompiler/IR/Operations/GradSoftPlusOp.cs
- src/JitCompiler/IR/Operations/GradSoftSignOp.cs
- src/JitCompiler/IR/Operations/GradSoftmaxOp.cs
- src/JitCompiler/IR/Operations/GradSpMVOp.cs
- src/JitCompiler/IR/Operations/GradSparsemaxOp.cs
- src/JitCompiler/IR/Operations/GradSubtractOp.cs
- src/JitCompiler/IR/Operations/GradSumOp.cs
- src/JitCompiler/IR/Operations/GradSwishOp.cs
- src/JitCompiler/IR/Operations/GradTanhOp.cs
- src/JitCompiler/IR/Operations/GradThresholdedReLUOp.cs
- src/JitCompiler/IR/Operations/GradTransposeOp.cs
- src/JitCompiler/IR/Operations/GridSampleOp.cs
- src/JitCompiler/IR/Operations/HardSigmoidOp.cs
- src/JitCompiler/IR/Operations/GraphConvOp.cs
- src/JitCompiler/IR/Operations/LiSHTOp.cs
- src/JitCompiler/IR/Operations/LogOp.cs
- src/JitCompiler/IR/Operations/NormOp.cs
- src/JitCompiler/IR/Operations/MobiusAddOp.cs
- src/JitCompiler/IR/Operations/OctonionMultiplyOp.cs
- src/JitCompiler/IR/Operations/MeanOp.cs
- src/JitCompiler/IR/Operations/LogSoftminOp.cs
- src/JitCompiler/IR/Operations/MatMulOp.cs
- src/JitCompiler/IR/Operations/NegateOp.cs
- src/JitCompiler/IR/Operations/MishOp.cs
- src/JitCompiler/IR/Operations/PReLUOp.cs
- src/JitCompiler/IR/Operations/PoincareLogMapOp.cs
- src/JitCompiler/IR/Operations/SignOp.cs
- src/Configuration/JitCompilationConfig.cs
- src/Genetics/ModelIndividual.cs
- src/Interfaces/IAiModelBuilder.cs
- src/Interfaces/IJitCompilable.cs
- src/JitCompiler/CodeGen/FP16Kernels.cs
- src/JitCompiler/CodeGen/GPUKernelLibrary.cs
- src/JitCompiler/CodeGen/IGPURuntime.cs
- src/JitCompiler/CodeGen/MockGPURuntime.cs
- src/JitCompiler/CodeGen/RecurrentOps.cs
- src/JitCompiler/CodeGen/SIMDCapabilities.cs
- src/JitCompiler/CodeGen/SIMDOptimizer.cs
- src/JitCompiler/CodeGen/SIMDStats.cs
- src/JitCompiler/CodeGen/WorkspaceCodeGenerator.cs
- src/JitCompiler/CompilationStats.cs
- src/JitCompiler/HybridCompilationResult.cs
- src/JitCompiler/IR/IRGraph.cs
- src/JitCompiler/IR/Operations/ConstantOp.cs
- src/JitCompiler/IR/Operations/DifferentiableApproximationOps.cs
- src/JitCompiler/IR/Operations/FusedAddReLUOp.cs
- src/JitCompiler/IR/Operations/GradConv2DOp.cs
- src/JitCompiler/IR/Operations/GradConvTranspose2DOp.cs
- src/JitCompiler/IR/Operations/GradRReLUOp.cs
- src/JitCompiler/IR/Operations/GradSpMMOp.cs
- src/JitCompiler/IR/Operations/HardTanhOp.cs
- src/JitCompiler/IR/Operations/GradPadOp.cs
- src/JitCompiler/IR/Operations/GradUpsampleOp.cs
- src/JitCompiler/IR/Operations/HierarchicalSoftmaxOp.cs
- src/JitCompiler/IR/Operations/ISRUOp.cs
- src/JitCompiler/IR/Operations/GroupNormOp.cs
- src/JitCompiler/IR/Operations/LeakyReLUOp.cs
- src/JitCompiler/IR/Operations/LSTMCellOp.cs
- src/JitCompiler/IR/Operations/LayerNormOp.cs
- src/JitCompiler/IR/Operations/MultiHeadAttentionOp.cs
- src/JitCompiler/IR/Operations/LocallyConnectedConv2DOp.cs
- src/JitCompiler/IR/Operations/LogSoftmaxOp.cs
- src/JitCompiler/IR/Operations/MaxPool2DOp.cs
- src/JitCompiler/IR/Operations/OctonionMatMulOp.cs
- src/JitCompiler/IR/Operations/PixelShuffleOp.cs
- src/JitCompiler/IR/Operations/PowerOp.cs
- src/JitCompiler/IR/Operations/FusedConvBatchNormOp.cs
- src/JitCompiler/IR/Operations/PadOp.cs
- src/JitCompiler/IR/Operations/MaxoutOp.cs
- src/JitCompiler/IR/Operations/ReduceMaxOp.cs
- src/JitCompiler/IR/Operations/ScaledDotProductAttentionOp.cs
- src/JitCompiler/IR/Operations/ReduceMeanOp.cs
- src/JitCompiler/IR/Operations/SoftSignOp.cs
- src/JitCompiler/IR/Operations/SELUOp.cs
- src/JitCompiler/IR/Operations/SqrtOp.cs
- src/JitCompiler/IR/Operations/SQRBFOp.cs
- src/JitCompiler/IR/Operations/SquashOp.cs
- src/JitCompiler/IR/Operations/ScaledTanhOp.cs
- src/JitCompiler/IR/Operations/ThresholdedReLUOp.cs
- src/JitCompiler/IR/Operations/RBFKernelOp.cs
- src/JitCompiler/CodeGen/CodeGenerator.cs
- src/JitCompiler/IR/IROp.cs
- src/JitCompiler/IR/Operations/FusedElementwiseChainOp.cs
- src/JitCompiler/IR/Operations/FusedResidualBlockOp.cs
- src/JitCompiler/IR/Operations/PoincareExpMapOp.cs
- src/JitCompiler/IR/Operations/ReLUOp.cs
- src/JitCompiler/IR/Operations/RReLUOp.cs
- src/JitCompiler/IR/Operations/SpMMOp.cs
- src/JitCompiler/IR/Operations/ReshapeOp.cs
- src/JitCompiler/IR/Operations/SoftminOp.cs
- src/JitCompiler/IR/Operations/ScalarConstantOp.cs
- src/JitCompiler/IR/Operations/ReduceLogVarianceOp.cs
- src/JitCompiler/IR/Operations/SphericalSoftmaxOp.cs
- src/JitCompiler/IR/Operations/SigmoidOp.cs
- src/JitCompiler/IR/Operations/SpMVOp.cs
- src/JitCompiler/IR/Operations/SplitOp.cs
- src/JitCompiler/Memory/TensorRental.cs
- src/JitCompiler/IR/Operations/SumOp.cs
- src/JitCompiler/IR/Operations/UpsampleOp.cs
- src/JitCompiler/IR/Operations/WedgeProductOp.cs
- src/JitCompiler/Memory/TensorPool.cs
- src/JitCompiler/IR/Operations/TanhOp.cs
- src/JitCompiler/IR/Operations/GradSplitOp.cs
- src/JitCompiler/IR/Operations/SubtractOp.cs
- src/JitCompiler/IR/Operations/GradLiSHTOp.cs
- src/JitCompiler/IR/Operations/SquareOp.cs
- src/JitCompiler/IR/Operations/TransposeOp.cs
- src/JitCompiler/IR/Operations/SwishOp.cs
- src/JitCompiler/IR/Operations/SoftmaxOp.cs
- src/JitCompiler/Memory/TensorPoolStats.cs
- src/JitCompiler/JitCompiler.cs
- src/JitCompiler/IR/Operations/SliceOp.cs
- src/JitCompiler/IR/Operations/SoftPlusOp.cs
- src/JitCompiler/IR/Operations/SparsemaxOp.cs
- src/JitCompiler/IR/Operations/TaylorSoftmaxOp.cs
- src/JitCompiler/JitCompatibilityResult.cs
- src/JitCompiler/IR/TensorShape.cs
- src/JitCompiler/CodeGen/VectorHelper.cs
- src/JitCompiler/IR/Operations/VectorizedOps.cs
- src/JitCompiler/JitCompilerOptions.cs
- src/JitCompiler/IRBuilder.cs
- src/JitCompiler/CodeGen/GradientOps.cs
Rejects zero or negative values with ArgumentOutOfRangeException. Addresses review comment about accepting invalid maxParallelism. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 257 out of 309 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| /// </para> | ||
| /// </remarks> | ||
| public bool IsGPUEnabled => _useGPU && _gpuRuntime != null; | ||
| public bool IsGPUEnabled => false; |
There was a problem hiding this comment.
Changing DeviceInfo from a concrete GPUDeviceInfo? to object? is a breaking API change and makes the contract unclear for consumers. If this type is part of the public API, consider (mandatory) either removing DeviceInfo entirely, or keeping a strongly-typed property via an engine-level device info abstraction (e.g., IGpuDeviceInfo) and returning null when unavailable; alternatively mark the old property [Obsolete] and introduce a new well-typed replacement to avoid object.
| /// </para> | ||
| /// </remarks> | ||
| public GPUCodeGenerator.GPUDeviceInfo? DeviceInfo => _gpuRuntime?.DeviceInfo; | ||
| public object? DeviceInfo => null; |
There was a problem hiding this comment.
Changing DeviceInfo from a concrete GPUDeviceInfo? to object? is a breaking API change and makes the contract unclear for consumers. If this type is part of the public API, consider (mandatory) either removing DeviceInfo entirely, or keeping a strongly-typed property via an engine-level device info abstraction (e.g., IGpuDeviceInfo) and returning null when unavailable; alternatively mark the old property [Obsolete] and introduce a new well-typed replacement to avoid object.
| /// is now handled at the Tensors engine level. This helper uses CPU parallelism. | ||
| /// </remarks> | ||
| public GPUExplainerHelper(IGPURuntime? gpuRuntime = null, int? maxParallelism = null) | ||
| public GPUExplainerHelper(int? maxParallelism = null) |
There was a problem hiding this comment.
Changing DeviceInfo from a concrete GPUDeviceInfo? to object? is a breaking API change and makes the contract unclear for consumers. If this type is part of the public API, consider (mandatory) either removing DeviceInfo entirely, or keeping a strongly-typed property via an engine-level device info abstraction (e.g., IGpuDeviceInfo) and returning null when unavailable; alternatively mark the old property [Obsolete] and introduce a new well-typed replacement to avoid object.
| public static GPUExplainerHelper<T> CreateWithAutoDetect() | ||
| { | ||
| // For now, use MockGPURuntime for consistent behavior | ||
| // In production, this could detect CUDA, OpenCL, or Metal availability | ||
| return new GPUExplainerHelper<T>(new MockGPURuntime()); | ||
| // GPU runtime has been removed — returns CPU-only helper | ||
| return new GPUExplainerHelper<T>(); | ||
| } |
There was a problem hiding this comment.
CreateWithAutoDetect() no longer performs detection and always returns a CPU-only helper, so the method name is now misleading. Consider (mandatory) renaming it to something like CreateDefault() / CreateCPUOnly() (or removing it and keeping CreateCPUOnly) to avoid incorrect expectations from callers.
| public virtual bool SupportsJitCompilation => false; | ||
|
|
||
| return InterfaceGuard.JitCompilable(WrappedModel).SupportsJitCompilation; | ||
| } | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Exports the computation graph for JIT compilation by delegating to the wrapped model. | ||
| /// </summary> | ||
| /// <param name="inputNodes">List to populate with input computation nodes.</param> | ||
| /// <returns>The output computation node representing the model's prediction.</returns> | ||
| /// <remarks> | ||
| /// <para> | ||
| /// Sharded models delegate graph export to their wrapped model. | ||
| /// The computation graph represents the full model's forward pass, independent of parameter sharding. | ||
| /// </para> | ||
| /// <para><b>For Beginners:</b> This creates a computation graph from the wrapped model. | ||
| /// | ||
| /// Even though parameters are distributed (sharded) across multiple processes: | ||
| /// - The computation graph structure is the same for all processes | ||
| /// - Each process compiles the same graph into fast code | ||
| /// - The only difference is which parameter values each process uses | ||
| /// | ||
| /// This allows distributed models to benefit from JIT compilation while maintaining | ||
| /// their distributed training capabilities. | ||
| /// </para> | ||
| /// </remarks> | ||
| /// <exception cref="ArgumentNullException">Thrown when inputNodes is null.</exception> | ||
| /// <exception cref="NotSupportedException"> | ||
| /// Thrown when the wrapped model does not support JIT compilation. | ||
| /// </exception> | ||
| public virtual ComputationNode<T> ExportComputationGraph(List<ComputationNode<T>> inputNodes) | ||
| { | ||
| if (inputNodes == null) | ||
| throw new ArgumentNullException(nameof(inputNodes)); | ||
|
|
||
| if (WrappedModel is null || WrappedModel == null) | ||
| throw new InvalidOperationException( | ||
| "Cannot export computation graph: Wrapped model is null."); | ||
|
|
||
| if (!InterfaceGuard.JitCompilable(WrappedModel).SupportsJitCompilation) | ||
| throw new NotSupportedException( | ||
| $"The wrapped model of type {WrappedModel.GetType().Name} does not support JIT compilation. " + | ||
| "JIT compilation availability depends on the wrapped model's capabilities."); | ||
|
|
||
| return InterfaceGuard.JitCompilable(WrappedModel).ExportComputationGraph(inputNodes); | ||
| throw new NotSupportedException("JIT compilation has been removed."); | ||
| } |
There was a problem hiding this comment.
Now that IJitCompilable<T> has been removed, keeping SupportsJitCompilation/ExportComputationGraph members (especially with JIT-centric naming) increases confusion and ongoing maintenance burden. Consider (mandatory) removing these members entirely (and any surrounding regions/docs) unless another interface still requires them; if you must keep them temporarily for source compatibility, mark them [Obsolete] with guidance on the engine-level alternative.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
src/Interpretability/Helpers/GPUExplainerHelper.cs (5)
85-103:⚠️ Potential issue | 🟡 Minor
CreateWithAutoDetectdocumentation references non-existent GPU detection.The XML docs still describe GPU auto-detection and reference "Mock GPU" (line 95) which no longer exists. The method now simply returns a CPU-only helper. Update documentation to match reality:
Suggested documentation update
/// <summary> -/// Creates a GPU explainer helper with automatic GPU detection. +/// Creates an explainer helper with default parallelism settings. /// </summary> -/// <returns>A helper configured with the best available compute device.</returns> +/// <returns>A helper using CPU parallelism with default thread count.</returns> /// <remarks> /// <para> -/// <b>For Beginners:</b> This factory method automatically detects if a GPU is available -/// and configures the helper appropriately. Use this when you want the best performance -/// without manually managing GPU resources. -/// -/// Currently returns a CPU-based helper (Mock GPU) since actual GPU detection requires -/// platform-specific code. Future versions may include actual GPU detection. +/// <b>For Beginners:</b> This factory method creates a helper with default settings. +/// GPU acceleration is now handled at the Tensors engine level; this helper +/// provides CPU parallelism for explainer-specific operations. /// </para> /// </remarks>🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Interpretability/Helpers/GPUExplainerHelper.cs` around lines 85 - 103, Update the XML docs for CreateWithAutoDetect to reflect that there is no GPU detection or "Mock GPU" and the method returns a CPU-only helper: change the summary/remarks to state it returns a CPU-only GPUExplainerHelper<T> (no GPU detection performed), remove references to "Mock GPU" and platform-specific detection, and ensure the doc clearly advises callers that future versions may add GPU support if applicable while referencing the CreateWithAutoDetect method name and GPUExplainerHelper<T> class so the intent is clear.
241-273:⚠️ Potential issue | 🟠 MajorBlocking: 30+ lines of dead GPU code in coalition computation.
The entire GPU branch (lines 241-273) is unreachable since
IsGPUEnabledis alwaysfalse. This bloats the method and misleads future maintainers into thinking GPU support exists.Proposed fix: Remove dead GPU branch, keep CPU logic only
var coalitionPredictions = new T[numCoalitions]; - if (IsGPUEnabled) - { - // Build all masked inputs at once for GPU processing - var allMaskedInputs = new T[numCoalitions * nBackground, numFeatures]; - - for (int c = 0; c < numCoalitions; c++) - { - var coalition = coalitions[c]; - for (int b = 0; b < nBackground; b++) - { - int row = c * nBackground + b; - for (int j = 0; j < numFeatures; j++) - { - allMaskedInputs[row, j] = coalition[j] ? instance[j] : backgroundData[b, j]; - } - } - } - - // Single GPU prediction call - var allMaskedMatrix = new Matrix<T>(allMaskedInputs); - var allPredictions = predictFunction(allMaskedMatrix); - - // Average predictions for each coalition - for (int c = 0; c < numCoalitions; c++) - { - double sum = 0; - for (int b = 0; b < nBackground; b++) - { - sum += NumOps.ToDouble(allPredictions[c * nBackground + b]); - } - coalitionPredictions[c] = NumOps.FromDouble(sum / nBackground); - } - } - else - { - // CPU parallel processing by coalition + // CPU parallel processing by coalition + Parallel.For(0, numCoalitions, new ParallelOptions { MaxDegreeOfParallelism = _maxParallelism }, c => + { // ... existing CPU implementation ... - } + });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Interpretability/Helpers/GPUExplainerHelper.cs` around lines 241 - 273, The IsGPUEnabled branch contains dead GPU-specific code (building allMaskedInputs, Matrix<T> usage, predictFunction on a large matrix, and averaging into coalitionPredictions) that is never executed; remove the entire if (IsGPUEnabled) { ... } block and its internal symbols (allMaskedInputs, allMaskedMatrix, allPredictions, and the averaging loop) and keep only the existing CPU coalition computation path so coalitionPredictions is produced by the active CPU logic; ensure no remaining references to Matrix<T> or those temporary variables remain in GPUExplainerHelper.cs and that predictFunction usage stays with the CPU flow.
152-170:⚠️ Potential issue | 🟠 MajorBlocking: Unreachable GPU code path is dead code.
IsGPUEnabledis hardcoded tofalse, making this conditional branch and theBatchPredictGPUmethod completely unreachable. Dead code violates production readiness requirements and should be removed.Proposed fix: Remove dead GPU branch
// Use parallel batch processing - if (IsGPUEnabled) - { - return BatchPredictGPU(predictFunction, inputs); - } - else - { - return BatchPredictCPU(predictFunction, inputs); - } + return BatchPredictCPU(predictFunction, inputs); } - -/// <summary> -/// GPU-accelerated batch prediction. -/// </summary> -private Vector<T> BatchPredictGPU(Func<Matrix<T>, Vector<T>> predictFunction, Matrix<T> inputs) -{ - // The GPU runtime processes the full batch in one call - // This is efficient because data transfer overhead is amortized - return predictFunction(inputs); -}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Interpretability/Helpers/GPUExplainerHelper.cs` around lines 152 - 170, IsGPUEnabled is hardcoded false so the GPU branch and BatchPredictGPU are dead code; remove the conditional branch that checks IsGPUEnabled and the private method BatchPredictGPU, and simplify the caller to always invoke BatchPredictCPU(predictFunction, inputs); alternatively if GPU support is intended later, make IsGPUEnabled configurable (not hardcoded) and keep both paths – reference symbols: IsGPUEnabled, BatchPredictGPU, BatchPredictCPU, predictFunction.
8-42:⚠️ Potential issue | 🟡 MinorClass documentation is misleading—advertises removed GPU capabilities.
The class summary still promotes GPU acceleration benefits ("10-100x speedup", "GPU Matrix Operations", "GPU version can process thousands of inputs simultaneously") that no longer exist. This sets incorrect expectations for users.
Consider updating the documentation to reflect the current CPU-parallel-only reality:
Suggested documentation update
/// <summary> -/// Provides GPU acceleration for interpretability explainers. +/// Provides parallel processing acceleration for interpretability explainers. /// </summary> /// <typeparam name="T">The numeric type for calculations.</typeparam> /// <remarks> /// <para> -/// <b>For Beginners:</b> This helper accelerates interpretability computations using GPU hardware. +/// <b>For Beginners:</b> This helper accelerates interpretability computations using CPU parallelism. /// Many explanation methods (SHAP, Integrated Gradients, etc.) require computing many predictions -/// or gradients - operations that are perfect for GPU parallelization. +/// or gradients - operations that benefit from parallel processing. /// /// The helper provides: /// 1. <b>Batch Prediction</b>: Process many inputs simultaneously /// 2. <b>Parallel Coalition Processing</b>: For SHAP-style algorithms -/// 3. <b>GPU Matrix Operations</b>: Fast linear algebra for solving attribution problems -/// 4. <b>Automatic Fallback</b>: Falls back to CPU if no GPU is available -/// -/// Benefits of GPU acceleration for explainers: -/// - 10-100x speedup for batch predictions -/// - Enables real-time explanations for complex models -/// - Makes ensemble/sample-based methods practical for large models +/// 3. <b>Parallel Matrix Operations</b>: Fast linear algebra for solving attribution problems +/// +/// Note: GPU acceleration is now handled at the Tensors engine level. +/// This helper provides CPU-based parallelism for explainer-specific operations.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Interpretability/Helpers/GPUExplainerHelper.cs` around lines 8 - 42, Update the XML doc for class GPUExplainerHelper<T> to remove misleading GPU-specific claims and performance numbers and instead clearly state the current CPU-parallel-only behavior and fallback semantics; mention that CreateWithAutoDetect, BatchPredict, and ComputeCoalitionPredictions now run on CPU with parallel processing where applicable, remove phrases like "10-100x speedup", "GPU Matrix Operations", and "process thousands of inputs simultaneously", and add a brief note about any automatic GPU detection now being deprecated or acting as a no-op so users have accurate expectations.
442-491:⚠️ Potential issue | 🟠 MajorBlocking: Parallel matrix computation branch is unreachable.
The condition
m > 10 && IsGPUEnabledis alwaysfalsebecauseIsGPUEnabledis hardcoded tofalse. Ironically, this branch usesParallel.For(CPU parallelism), not GPU—it would actually be useful for large matrices but is permanently disabled.Either remove the dead code or change the condition to enable CPU parallelism for larger matrices:
Option A: Enable CPU parallelism (recommended)
- if (m > 10 && IsGPUEnabled) + if (m > 10) { // Use parallel outer products Parallel.For(0, m, j1 =>Option B: Remove dead branch entirely
// Compute in parallel (for large matrices) - if (m > 10 && IsGPUEnabled) - { - // Use parallel outer products - Parallel.For(0, m, j1 => - { - // ... parallel implementation ... - }); - } - else - { - // Sequential for small matrices + // Sequential computation for (int j1 = 0; j1 < m; j1++) { // ... sequential implementation ... } - }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Interpretability/Helpers/GPUExplainerHelper.cs` around lines 442 - 491, The branch guarded by "m > 10 && IsGPUEnabled" is unreachable because IsGPUEnabled is hardcoded false, disabling the Parallel.For CPU parallelism; either remove the dead branch or enable CPU parallelism by changing the condition to "m > 10" (or a new flag like UseCpuParallelism) so the Parallel.For block that computes XtWX and XtWy actually runs for large m; update references in GPUExplainerHelper (the method that fills XtWX/XtWy using NumOps.ToDouble and Parallel.For) accordingly and ensure symmetry of behavior between the parallel and sequential loops.
♻️ Duplicate comments (1)
src/Interpretability/Helpers/GPUExplainerHelper.cs (1)
101-102: 🧹 Nitpick | 🔵 TrivialFactory method implementation is correct but consider renaming.
The implementation is straightforward and correct. However,
CreateWithAutoDetect()is now semantically identical toCreateCPUOnly(). Consider whether to deprecate this method or rename it to avoid confusion:+[Obsolete("GPU auto-detection was removed. Use CreateCPUOnly() instead.")] public static GPUExplainerHelper<T> CreateWithAutoDetect() { - // GPU runtime has been removed — returns CPU-only helper - return new GPUExplainerHelper<T>(); + return CreateCPUOnly(); }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/Interpretability/Helpers/GPUExplainerHelper.cs` around lines 101 - 102, CreateWithAutoDetect() currently just returns new GPUExplainerHelper<T>() and is semantically identical to CreateCPUOnly(); rename or deprecate to avoid confusion: either rename CreateWithAutoDetect to CreateCPUOnly (or CreateCPUHelper) and update all callers to the new name, or mark CreateWithAutoDetect with an [Obsolete] attribute and update its implementation to forward to CreateCPUOnly() (or vice versa) so there is a single clear factory method (referencing CreateWithAutoDetect(), CreateCPUOnly(), and GPUExplainerHelper<T> to locate the code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/Interpretability/Helpers/GPUExplainerHelper.cs`:
- Around line 85-103: Update the XML docs for CreateWithAutoDetect to reflect
that there is no GPU detection or "Mock GPU" and the method returns a CPU-only
helper: change the summary/remarks to state it returns a CPU-only
GPUExplainerHelper<T> (no GPU detection performed), remove references to "Mock
GPU" and platform-specific detection, and ensure the doc clearly advises callers
that future versions may add GPU support if applicable while referencing the
CreateWithAutoDetect method name and GPUExplainerHelper<T> class so the intent
is clear.
- Around line 241-273: The IsGPUEnabled branch contains dead GPU-specific code
(building allMaskedInputs, Matrix<T> usage, predictFunction on a large matrix,
and averaging into coalitionPredictions) that is never executed; remove the
entire if (IsGPUEnabled) { ... } block and its internal symbols
(allMaskedInputs, allMaskedMatrix, allPredictions, and the averaging loop) and
keep only the existing CPU coalition computation path so coalitionPredictions is
produced by the active CPU logic; ensure no remaining references to Matrix<T> or
those temporary variables remain in GPUExplainerHelper.cs and that
predictFunction usage stays with the CPU flow.
- Around line 152-170: IsGPUEnabled is hardcoded false so the GPU branch and
BatchPredictGPU are dead code; remove the conditional branch that checks
IsGPUEnabled and the private method BatchPredictGPU, and simplify the caller to
always invoke BatchPredictCPU(predictFunction, inputs); alternatively if GPU
support is intended later, make IsGPUEnabled configurable (not hardcoded) and
keep both paths – reference symbols: IsGPUEnabled, BatchPredictGPU,
BatchPredictCPU, predictFunction.
- Around line 8-42: Update the XML doc for class GPUExplainerHelper<T> to remove
misleading GPU-specific claims and performance numbers and instead clearly state
the current CPU-parallel-only behavior and fallback semantics; mention that
CreateWithAutoDetect, BatchPredict, and ComputeCoalitionPredictions now run on
CPU with parallel processing where applicable, remove phrases like "10-100x
speedup", "GPU Matrix Operations", and "process thousands of inputs
simultaneously", and add a brief note about any automatic GPU detection now
being deprecated or acting as a no-op so users have accurate expectations.
- Around line 442-491: The branch guarded by "m > 10 && IsGPUEnabled" is
unreachable because IsGPUEnabled is hardcoded false, disabling the Parallel.For
CPU parallelism; either remove the dead branch or enable CPU parallelism by
changing the condition to "m > 10" (or a new flag like UseCpuParallelism) so the
Parallel.For block that computes XtWX and XtWy actually runs for large m; update
references in GPUExplainerHelper (the method that fills XtWX/XtWy using
NumOps.ToDouble and Parallel.For) accordingly and ensure symmetry of behavior
between the parallel and sequential loops.
---
Duplicate comments:
In `@src/Interpretability/Helpers/GPUExplainerHelper.cs`:
- Around line 101-102: CreateWithAutoDetect() currently just returns new
GPUExplainerHelper<T>() and is semantically identical to CreateCPUOnly(); rename
or deprecate to avoid confusion: either rename CreateWithAutoDetect to
CreateCPUOnly (or CreateCPUHelper) and update all callers to the new name, or
mark CreateWithAutoDetect with an [Obsolete] attribute and update its
implementation to forward to CreateCPUOnly() (or vice versa) so there is a
single clear factory method (referencing CreateWithAutoDetect(),
CreateCPUOnly(), and GPUExplainerHelper<T> to locate the code).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 54112edd-e853-4740-88ab-197ac5533f3e
📒 Files selected for processing (1)
src/Interpretability/Helpers/GPUExplainerHelper.cs
Summary
src/JitCompiler/directory (238 files) — IR, codegen, optimization passes, memory pool, gradient opsIJitCompilable<T>interface andJitCompilationConfigconfiguration classIEngineoperations for automatic tape-based differentiationWhy
The per-layer JIT compiler has been superseded by the Lazy Tensor Graph Compiler in
AiDotNet.Tensors v0.28.0, which operates at the engine level and provides automatic tape recording for all operations. The per-layer system was redundant and added maintenance burden without benefit.What Changed
src/JitCompiler/(238 source files),IJitCompilable.cs,JitCompilationConfig.csAiModelBuilder.ConfiguredJitCompilation, YAML config loader/schema/docsMergedPRBugFixTests,YamlConfigTeststo remove JIT assertionsVerification
IEngineoperations (onlyRotaryPositionalEncodingLayerhas no Engine ops — it is non-trainable with zero parameters)Test plan
AiDotNet.JitCompilernamespace in any project🤖 Generated with Claude Code
Summary by CodeRabbit
Refactor
Chores