Skip to content

CNPreferences ​

Function reference for CNPreferences. Preferences write LocalPreferences.toml and generally require a fresh Julia process.

Out of the box (no LocalPreferences.toml changes):

SettingDefault
Binary / build modeJLL prebuilt binaries
Broadcast fusionon
FUSE_BROADCAST_MIN_OPS2 (single native operations stay unfused)
Task scope namesoff
MIN_SOLVE_MATRIX_SIZE2048 rows
MIN_SOLVE_TILE_SIZE512
MIN_CHOLESKY_MATRIX_SIZE8192 rows
MIN_CHOLESKY_TILE_SIZE2048
MIN_QR_MATRIX_SIZE1048576 elements
QR_TILE_SIZE128
MAX_CHOLESKY_TILES_PER_PROC4

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.

julia
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
julia
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.

julia
CNPreferences.set_linalg!(; MIN_SOLVE_MATRIX_SIZE=4096, MIN_SOLVE_TILE_SIZE=512)
source

Build mode ​

julia
CNPreferences.use_jll_binary()      # use the prebuilt wrapper
CNPreferences.use_developer_mode()  # build the wrapper against prebuilt dependencies

Restart 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.

julia
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-ops

set_broadcast_fusion_min_ops! counts Broadcasted nodes (ops) in the tree:

  • 2 (default): fuse multi-op trees such as y .= @. a * b + c. Single native operations like y .= 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
julia
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.

source
CNPreferences.enable_broadcast_fusion! Function
julia
enable_broadcast_fusion!(; export_prefs=false, force=true)

Enable broadcast fusion. This is the default.

source
CNPreferences.disable_broadcast_fusion! Function
julia
disable_broadcast_fusion!(; export_prefs=false, force=true)

Disable broadcast fusion so each broadcast node runs as a separate cuNumeric op.

source
CNPreferences.set_broadcast_fusion_min_ops! Function
julia
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.

source

Task 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.

julia
using CNPreferences
CNPreferences.enable_task_scope_names!()
CNPreferences.disable_task_scope_names!()  # default

Restart Julia after changing this preference (it is compile-time in cuNumeric.jl).

CNPreferences.set_task_scope_names! Function
julia
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.

source
CNPreferences.enable_task_scope_names! Function
julia
enable_task_scope_names!(; export_prefs=false, force=true)

Enable named Legate task scopes for debugging. See set_task_scope_names!.

source
CNPreferences.disable_task_scope_names! Function
julia
disable_task_scope_names!(; export_prefs=false, force=true)

Disable named Legate task scopes. This is the default.

source