Remove return-false placeholder optimizer classes that were never
registered or wired into any optimization pass:
- FuseAttentionWithProjection (AttentionFusionOptimizations)
- FuseDequantizeQuantizePair (QuantizationOptimizations)
- OptimizeConstantsForInference (QuantizationOptimizations)
- QuantizePlaceholder (QuantizationOptimizations)
PR16 stripped DSP integration from SameDiff.java and InferenceSession.java,
removing DynamicShapePlanExecutor imports, dynamicShapePlanCache field,
nativePlanCache handle, setDspAutoCompileEnabled(), clearDynamicShapePlanCache(),
graphExecutionMode, WorkspaceInferenceFactory, per-instance inferenceFactory,
SDAudio/SDSignal/SDTraining op creators, placeholderOverrides, and related fields.
Also missing: 42 config/ files (PEFT, RL alignment, training configs), peft/,
rl/, training/ subdirectories, internal/memory workspace managers,
GatedDeltaNetFusionOptimizations, ModelLoadingContext, ModelSizeInfo, and
serde/TransferLearning classes.
Restored all of the above from ag_new_release_updates_2 to ensure PR16 merges
cleanly after PR15 without losing DSP integration.
The GatedDeltaNetFusionOptimizations class was a pure stub — its single
inner optimizer always returns false with a TODO comment and no patterns
implemented. Including it in the default optimizer list adds a no-op pass
that wastes cycles iterating over every op in the graph. Delete the file
and remove it from GraphOptimizer.defaultOptimizations().
The QuantizationOptimizations.QuantizeConstantsToFP16 optimizer was enabling
FP16 quantization by default (opt-out), contradicting the class-level javadoc
which stated "FP16 quantization is OFF by default". This changes the logic so
FP16 is only active when -Dnd4j.optimizer.fp16=true is explicitly set.
Also adds ND4JSystemProperties.OPTIMIZER_FP16 and OPTIMIZER_BF16 constants so
both the code and callers use named constants instead of raw string literals.
Part of the 22-PR split of ag_new_release_updates_2 branch.
Merge layer: 5 (java features)
Files: 63
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>