Performance Debugging
Diagnosing and resolving performance issues in DL4J and ND4J — profiling, OpProfiler, ETL bottlenecks, GC overhead, and backend verification.
Overview
Step 1: Verify the Correct Backend Is Active
o.n.l.f.Nd4jBackend - Loaded [CpuBackend] backend
o.n.l.a.o.e.DefaultOpExecutioner - Backend used: [CPU]; OS: [Linux]
o.n.l.a.o.e.DefaultOpExecutioner - Blas vendor: [MKL]o.n.l.f.Nd4jBackend - Loaded [JCublasBackend] backend
o.n.l.a.o.e.DefaultOpExecutioner - Backend used: [CUDA]; OS: [Linux]
o.n.l.a.o.e.DefaultOpExecutioner - Device Name: [NVIDIA GeForce RTX 3090]; CC: [8.6]Step 2: Check for cuDNN (GPU Only)
Step 3: Check for ETL Bottlenecks
Step 4: Reduce Garbage Collection Overhead
Measuring GC Impact
Reducing GC Impact
Step 5: Check Minibatch Size
Device
Recommended minimum batch
Step 6: Avoid Using One Model from Multiple Threads
Step 7: Verify Data Types
Step 8: Verify Workspaces Are Enabled
Step 9: Check for Network Architecture Bottlenecks
Step 10: Check for CPU-Only Ops (GPU Builds)
Step 11: OMP_NUM_THREADS for Concurrent Threads
Step 12: Check Other Processes Using Resources
JVM Profiling
YourKit Java Profiler
VisualVM
Profiling on Spark
ND4J OpProfiler
Common Anti-Patterns Summary
Anti-pattern
Symptom
Fix
Related Pages
Last updated
Was this helpful?