CNPreferences
Function reference for CNPreferences. Preferences write LocalPreferences.toml and generally require a fresh Julia process.
Out of the box (no LocalPreferences.toml changes):
| Setting | Default |
|---|---|
| Binary / build mode | JLL prebuilt binaries |
| Broadcast fusion | on |
FUSE_BROADCAST_MIN_OPS | 2 (single native operations stay unfused) |
| Task scope names | off |
MIN_SOLVE_MATRIX_SIZE | 2048 rows |
MIN_SOLVE_TILE_SIZE | 512 |
MIN_CHOLESKY_MATRIX_SIZE | 8192 rows |
MIN_CHOLESKY_TILE_SIZE | 2048 |
MIN_QR_MATRIX_SIZE | 1048576 elements |
QR_TILE_SIZE | 128 |
MAX_CHOLESKY_TILES_PER_PROC | 4 |
Build-mode setup (JLL / developer) is documented under Build Modes.
Linear algebra
set_linalg! accepts the constant names above as keywords. All values must be positive integers. Unspecified settings are unchanged. Restart Julia to load the new constants. cuNumeric.versioninfo() shows the effective values.
CNPreferences.set_linalg!(; MIN_SOLVE_MATRIX_SIZE=4096, MIN_SOLVE_TILE_SIZE=512)See Tuning for selection rules and tuning details.
CNPreferences.set_linalg! Function
set_linalg!(; export_prefs=false, force=true, settings...)Set linear algebra tuning preferences using their constant names as keywords: MIN_SOLVE_MATRIX_SIZE (2048), MIN_SOLVE_TILE_SIZE (512), MIN_CHOLESKY_MATRIX_SIZE (8192), MIN_CHOLESKY_TILE_SIZE (2048), MIN_QR_MATRIX_SIZE (1048576 elements), QR_TILE_SIZE (128), and MAX_CHOLESKY_TILES_PER_PROC (4). All values must be positive integers. Unspecified settings are unchanged. Restart Julia after changing preferences.
CNPreferences.set_linalg!(; MIN_SOLVE_MATRIX_SIZE=4096, MIN_SOLVE_TILE_SIZE=512)Build mode
CNPreferences.use_jll_binary() # use the prebuilt wrapper
CNPreferences.use_developer_mode() # build the wrapper against prebuilt dependenciesRestart Julia after selecting the mode. For developer mode, rebuild the wrapper with Pkg.build("cuNumeric"). See Developer Mode.
Broadcast fusion
Defaults: fusion on, FUSE_BROADCAST_MIN_OPS == 2.
using CNPreferences
CNPreferences.enable_broadcast_fusion!() # default
CNPreferences.disable_broadcast_fusion!()
CNPreferences.set_broadcast_fusion_min_ops!(2) # default
CNPreferences.set_broadcast_fusion_min_ops!(1) # also fuse single-opsset_broadcast_fusion_min_ops! counts Broadcasted nodes (ops) in the tree:
2(default): fuse multi-op trees such asy .= @. a * b + c. Single native operations likey .= cos.(x)use the C-API path. Functions without a native implementation are fused on the GPU when their broadcast arguments are eligible.1: fuse every eligible expression, including single-ops.
Set the preference in one Julia process, then start a fresh process to use it.
CNPreferences.set_broadcast_fusion! Function
set_broadcast_fusion!(enabled::Bool; export_prefs=false, force=true)Enable or disable broadcast fusion. When enabled (the default), eligible nested broadcast expressions compile to a single CUDA PTX kernel.
Restart Julia after changing this preference.
sourceCNPreferences.enable_broadcast_fusion! Function
enable_broadcast_fusion!(; export_prefs=false, force=true)Enable broadcast fusion. This is the default.
sourceCNPreferences.disable_broadcast_fusion! Function
disable_broadcast_fusion!(; export_prefs=false, force=true)Disable broadcast fusion so each broadcast node runs as a separate cuNumeric op.
sourceCNPreferences.set_broadcast_fusion_min_ops! Function
set_broadcast_fusion_min_ops!(n::Integer; export_prefs=false, force=true)Fuse only when a broadcast tree has at least n ops. Default is 2, so single ops such as y .= cos.(x) stay on the unfused path. Set n = 1 to fuse those too. Values must be >= 1.
Restart Julia after changing this preference.
sourceTask scope names
Default: off. Optional Legate task-scope naming for debugging. When on, cuNumeric wraps many ops in Legate.with_scope so provenance strings (for example matmul, zeros, or fused broadcast.<expr>) appear in Legate logs and profiles. Pair this with --logging legate=debug --log-to-file (or --profile) in LEGATE_CONFIG. See Debugging.
using CNPreferences
CNPreferences.enable_task_scope_names!()
CNPreferences.disable_task_scope_names!() # defaultRestart Julia after changing this preference (it is compile-time in cuNumeric.jl).
CNPreferences.set_task_scope_names! Function
set_task_scope_names!(enabled::Bool; export_prefs=false, force=true)Enable or disable named Legate task scopes for debugging. Default is off.
When enabled, cuNumeric wraps ops in Legate.with_scope so provenance labels appear in Legate logs/profiles. Pair with LEGATE_CONFIG flags such as --logging legate=debug --log-to-file (set before Julia starts). Requires a fresh Julia process after changing the preference.
CNPreferences.enable_task_scope_names! Function
enable_task_scope_names!(; export_prefs=false, force=true)Enable named Legate task scopes for debugging. See set_task_scope_names!.
CNPreferences.disable_task_scope_names! Function
disable_task_scope_names!(; export_prefs=false, force=true)Disable named Legate task scopes. This is the default.
source