Repository navigation
refactor: migrate to AiDotNet.Tensors NuGet package - #741
Conversation
- Replace AiDotNet.Tensors project reference with NuGet package v0.1.0 - Remove src/AiDotNet.Tensors folder (now in separate repo) - Remove src/AiDotNet.Native.CLBlast folder (now in Tensors package) - Remove src/AiDotNet.Native.OpenBLAS folder (now in Tensors package) - Remove src/AiDotNet.Native.OneDNN placeholder folder - Remove tests/AiDotNet.Tensors.Tests (now in separate repo) - Remove tests/AiDotNet.Tensors.Benchmarks (now in separate repo) - Update testconsole and GpuDiagnostic to use NuGet package - Clean up solution file to remove deleted project references The AiDotNet.Tensors code has been spun out to a separate repository and published to NuGet: https://www.nuget.org/packages/AiDotNet.Tensors/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR migrates the AiDotNet.Tensors project from a local project reference to a published NuGet package (v0.1.0), separating tensor operations into an independent, versioned package. The changes remove the local tensor implementation code and native library folders, replacing them with NuGet package references.
Changes:
- Removed local AiDotNet.Tensors source code (~220K lines) and tests
- Removed native library folders (CLBlast, OpenBLAS, OneDNN)
- Updated project references to use AiDotNet.Tensors NuGet package v0.1.0
- Updated test and diagnostic projects to consume the NuGet package
Reviewed changes
Copilot reviewed 44 out of 374 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| Multiple CUDA kernel files | Complete removal of local CUDA kernel implementations (optimizer, octonion, normalization, neural net, mesh pool, LSTM, locally connected, hyperbolic, GRU, fused, FP16) |
| CudaSyncPoint.cs | Removal of CUDA synchronization point implementation |
| ActivationType.cs | Removal of activation type enum definition |
| IsExternalInit.cs | Removal of .NET Framework compatibility shim |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThis PR removes the AiDotNet.Tensors project and many native/GPU integrations: solution/project entries, native packaging (CLBlast/OneDNN/OpenBLAS), compatibility shims, CPU/GPU engines, DirectGpu/CUDA/cuBLAS/cuDNN bindings, and embedded CUDA kernel providers. Changes
Sequence Diagram(s)sequenceDiagram
participant App as Application
participant Engine as AiDotNetEngine
participant DirectGpu as DirectGpu Layer
participant Native as CUDA/cuBLAS/cuDNN
participant GPU as Device GPU
App->>Engine: request tensor operation (e.g., MatMul)
Engine->>DirectGpu: select DirectGpu backend, create context
DirectGpu->>Native: allocate/copy buffers, launch kernel
Native->>GPU: execute kernel / cuBLAS/cuDNN calls
GPU-->>Native: complete, return results
Native-->>DirectGpu: signal completion, copy back
DirectGpu-->>Engine: deliver result
Engine-->>App: return result
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
- Update AiDotNet.Tensors from v0.2.0 to v0.3.0 - Add AiDotNet.Native.OpenBLAS v0.3.0 (now includes native DLL) - Update AiDotNet.Native.CLBlast to v0.3.0 - Remove references to internal types (OneDnnProvider, BlasProvider) - Exclude GPU tuning tests that require internal Tensors types - Update benchmark and testconsole projects for NuGet package compatibility Note: OneDNN package will be added once v0.4.0 is released with the updated release workflow. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@AiDotNetBenchmarkTests/TorchSharpCpuComparisonBenchmarks.cs`:
- Line 57: The Console.WriteLine statement that unconditionally prints "AiDotNet
BLAS: enabled (via AiDotNet.Native.OpenBLAS package)" should be changed to a
non-assertive message or gated by an actual runtime check; locate the
Console.WriteLine after creating the CpuEngine instance and either (A) change
the text to indicate the package/reference is present but runtime loading may
vary (e.g., "AiDotNet BLAS: package referenced; runtime native load required")
or (B) query the engine for a native BLAS availability flag (e.g., a
property/method on CpuEngine such as IsNativeBlasLoaded or similar) and only
report "enabled" when that check returns true, otherwise log a
neutral/conditional message that it may not be available at runtime.
- Update AiDotNet.Tensors from 0.3.0 to 0.4.0 - Update AiDotNet.Native.OpenBLAS from 0.3.0 to 0.4.0 - Update AiDotNet.Native.CLBlast from 0.3.0 to 0.4.0 - Add AiDotNet.Native.OneDNN 0.4.0 for Intel CPU acceleration Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 379 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Change the benchmark log message to reflect that the package is referenced rather than asserting the native library is loaded at runtime. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace tensor.Data.Span[i] with tensor[i] to use the public flat indexer API available in the AiDotNet.Tensors NuGet package. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 380 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Replace .Data.Span[i] with [i] (flat indexer) - Replace .Data.Span with .AsSpan() - Replace .Data.Length with .Length - Replace .Data.ToArray() with .ToArray() - Replace data.AsSpan().CopyTo(t.Data.Span) with t.CopyFromArray(data) These changes use the public API available from the AiDotNet.Tensors NuGet package instead of the internal Data property. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 404 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update AiDotNetBenchmarkTests/Program.cs to work with the AiDotNet.Tensors NuGet package public API. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
d49780f to
a410ac0
Compare
AsSpan() returns ReadOnlySpan<T> in the NuGet package, so direct writes to span[i] fail with CS8331. Use tensor[i] indexer for write operations instead.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 49 out of 407 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
AiDotNet.Tensors.Tests project moved to separate AiDotNet.Tensors repository as part of the package spinout.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/sonarcloud.yml (1)
561-591: Remove the Node.js deletion before subsequentusessteps.Line 586 removes
/opt/hostedtoolcache/node, which the runner requires to execute subsequent JavaScript actions (checkout, setup-dotnet, cache, configure-pages, upload-pages-artifact, deploy-pages). Removing this will cause those steps to fail. Either remove this line or defer the Node deletion until after the finalusesstep.Proposed fix
- sudo rm -rf /opt/hostedtoolcache/node || true
Summary
This PR migrates from the embedded AiDotNet.Tensors source code to using the NuGet packages from the spun-out AiDotNet.Tensors repository.
Changes
AiDotNet.Tensorsv0.3.0 - Core tensor operationsAiDotNet.Native.OpenBLASv0.3.0 - CPU BLAS accelerationAiDotNet.Native.CLBlastv0.3.0 - GPU OpenCL accelerationNotes
Test plan
🤖 Generated with Claude Code