spikingjelly.configure module#

SpikingJelly package-level configuration.

API Language - 中文 | English


  • 中文

SpikingJelly 的库级选项通过 SJ_* 环境变量配置。环境变量在本模块首次导入时读取, 因此必须在启动 Python 前设置。未设置的选项使用下列文档中给出的默认值。

SJ_SAVE_DATASETS_COMPRESSED=0 python train.py

布尔环境变量遵循 PyTorch 的 0 / 1 风格,其中 0 表示 False, 1 表示 True。


  • English

SpikingJelly package-level options are configured through SJ_* environment variables. They are read when this module is first imported, so set them before starting Python. Unset options use the defaults documented below.

SJ_SAVE_DATASETS_COMPRESSED=0 python train.py

Boolean environment variables follow PyTorch's 0 / 1 convention: 0 means False and 1 means True.

spikingjelly.configure.max_threads_number_for_datasets_preprocess = 16#

数据集预处理使用的最大线程数,由 SJ_MAX_THREADS_NUMBER_FOR_DATASETS_PREPROCESS 配置,默认值为 16。

Maximum number of threads used for dataset preprocessing, configured by SJ_MAX_THREADS_NUMBER_FOR_DATASETS_PREPROCESS. The default is 16.

spikingjelly.configure.save_datasets_compressed = True#

是否以压缩 NPZ 格式保存事件和帧,由 SJ_SAVE_DATASETS_COMPRESSED 配置, 默认值为 1。压缩格式占用更少磁盘空间,但读取更慢。

Whether to save events and frames as compressed NPZ files, configured by SJ_SAVE_DATASETS_COMPRESSED. The default is 1. Compression uses less disk space but takes longer to read.

spikingjelly.configure.triton_neuron_kernel_static_range_max_T = 64#

Triton 多步神经元 kernel 使用 tl.static_range 的最大序列长度,由 SJ_TRITON_NEURON_KERNEL_STATIC_RANGE_MAX_T 配置,默认值为 64。超过该值时 使用 tl.range,以降低长序列的编译开销。

Maximum sequence length for which Triton multi-step neuron kernels use tl.static_range, configured by SJ_TRITON_NEURON_KERNEL_STATIC_RANGE_MAX_T. The default is 64. Larger sequences use tl.range to reduce compilation overhead.