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-op broadcasts stay unfused) |
| Task scope names | off |
Build-mode setup (JLL / conda / developer) is documented under Build Modes. Fusion usage tips live under Kernel Fusion.
Build mode
CNPreferences.use_jll_binary Function
LegatePreferences.use_jll_binary(; export_prefs = false, force = true)Tells Legate.jl | cuNumeric.jl to use JLLs. This is the default option.
sourceCNPreferences.use_conda Function
LegatePreferences.use_conda(conda_env::String; export_prefs = false, force = true)Tells Legate.jl | cuNumeric.jl to use existing conda install. We make no gurantees of compiler compatability at this time.
Expects conda_env to be the absolute path to the root of the environment. For example, /home/julialegate/.conda/envs/cunumeric-gpu
CNPreferences.use_developer_mode Function
LegatePreferences.use_developer_mode(; use_jll=true, path=nothing, export_prefs = false, force = true)
Tells Legate.jl | cuNumeric.jl to enable developer mode. Developer mode allows you to build from source.
To disable using legate_jll or cupynumeric_jll: use_jll=false If you disable legate_jll or cupynumeric_jll, then you need to set a path to Legate|cuPyNumeric with path="/path/to/Legate|cuPyNumeric"
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-ops likey .= cos.(x)stay on the unfused C-API path.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