- dot_product_attention_v2.cpp: replace std::unique_ptr<NDArray> attentionBiasCastOwner
with raw NDArray* + explicit delete; remove unused <memory> include
- onnx_multi_head_attention.cpp: replace std::unique_ptr<NDArray> attnBiasCastOwner
with raw NDArray* + explicit delete
- random.cu: replace 3 std::unique_ptr<NDArray> in fillRandomPoisson_ with raw pointers
+ explicit delete after use; remove unused <memory> include
- top_k.cu: replace std::shared_ptr<TadPack> with raw TadPack* (no delete — these are
cached singletons owned by ConstantTadHelper)
- llm.h: remove two commented-out op blocks (decoder_masked_mha, moe_gate) that
referenced /tmp/new_ops_backup/ — dead code with no valid path
- Loops.h: replace silent continue workaround with sd_debug warning so out-of-range
TAD offsets are visible in debug mode rather than silently swallowed
Replace __global__, __device__, __host__, __host__ __device__, and
__forceinline__ with SD_KERNEL, SD_DEVICE, SD_HOST, SD_HOST_DEVICE,
and SD_INLINE respectively across 28 .cu files under
libnd4j/include/ops/declarable/helpers/cuda/. Combined qualifiers
(__device__ __forceinline__) are replaced with SD_DEVICE SD_INLINE.
__launch_bounds__ attributes are preserved unchanged.
Part of the 22-PR split of ag_new_release_updates_2 branch.
Merge layer: 2 (native core)
Files: 841
See pr-plans/00-master-plan.md for the full split plan and merge order.
* Replace wildcard lombok imports with single class imports
This helps improve compatibility with delombok
* Removed unused lombok imports
Delombok doesn't remove unused imports
- Fixes memory leaks in 131 op implementations by adding proper delete calls
- Adds lifecycle tracking infrastructure for NDArray, DataBuffer, and caches
- Pattern: converts stack temporaries to pointer allocation with cleanup
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Fix C++ helper implementations
- TAD calculation fixes in gather, softmax
- Thread safety improvements (BLAS lock in batched_gemm)
- Edge case handling for empty arrays
- Various algorithm fixes in CPU/CUDA helpers
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix memory leak in cell_contains on early return
Restructure loop to avoid early returns that bypassed delete calls.
Uses result variable to track outcome and ensures cleanup always runs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Adds support for importing transformer/BERT models from ONNX:
- Attention, LayerNormalization, SkipLayerNormalization
- EmbedLayerNormalization, FastGelu, BiasGelu
- Microsoft ONNX Runtime custom ops
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_6_13_op_impl_base
* DeclarableOp: execution context memory management
* Remove engineers-guide-to-llms and pp-step-clone directories
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_6_7_cpu_helpers_1
* CPU helpers: GEMM and convolution memory fixes
* Remove engineers-guide-to-llms and pp-step-clone directories
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_1_3_maven_poms
* Update Maven POMs for CUDA backend and platform tests
* Remove engineers-guide-to-llms and pp-step-clone directories
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_4_2_graph_execution
* Graph execution context: memory management improvements
* Remove CRITICAL style comments, remove engineers-guide-to-llms and pp-step-clone
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix truncated RNG.h - redirect to RandomGenerator.h
The file was truncated mid-license header. Since RandomGenerator.h
contains the actual implementation, RNG.h now simply includes it.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_9_1_autodiff_core
* Autodiff core: memory management improvements
* Remove engineers-guide-to-llms and pp-step-clone directories
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix ControlFlow.java - restore full implementation with outputVarNames support
Adds overloaded methods for loopBody and invokeParams to support
passing outputVarNames to the parent graph.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_7_4_ops_core
* Ops header: type definitions update
* Remove engineers-guide-to-llms and pp-step-clone directories
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_3_2_array_impl
* Array implementations: buffer cleanup fixes, memory leak patches
* Remove engineers-guide-to-llms and pp-step-clone
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_5_2_cpu_loops
* CPU loops: broadcasting and summary stats fixes
* Remove engineers-guide-to-llms and pp-step-clone
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_6_10_cuda_helpers_1
* CUDA helpers: extract_patches memory fix
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_7_8_helpers_impl
* Helper implementations: memory management and reshape fixes
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_9_5_autodiff_internal
* InferenceSession: execution memory handling
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_6_8_cpu_helpers_2
* CPU helpers: LRN, skip-gram, softmax fixes
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_7_6_helpers_cpu
* CPU helpers: TAD calculator and SVD memory fixes
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_5_1_loop_headers
* Loop headers: type system updates, template fixes
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_7_2_legacy_impl
* Legacy impl: environment and cnpy updates
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_7_1_legacy_native
* NativeOps: lifecycle tracking integration, memory fixes
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
* Add files for pr_3_1_array_core
* Array core headers: memory management fixes, NaN prevention
* Remove pp-step-clone and engineers-guide-to-llms folders
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>