Environment Variables¶
MATE reads configuration from the current process environment. Set variables before launching the Python process or CLI command that should observe them.
Use mate env to print the MATE-related variables visible to the current
shell.
API Logging and Dumps¶
The logging and dumping configuration is read when mate.api_logging is
imported.
Variable |
Default |
Meaning |
|---|---|---|
|
|
API logging level: |
|
|
Log destination: |
|
|
Root directory for Level 10 tensor dumps |
|
|
Maximum total dump size in GB per process |
|
|
Maximum number of dumped calls per process |
|
|
Save dumps as |
|
empty |
Comma-separated |
|
empty |
Comma-separated |
Log-Level Meanings¶
0: Disabled.1: Function names only.3: Function names plus structured inputs and outputs, including tensor VA ranges.5: Level 3 plus tensor statistics.10: Level 5 plus on-disk tensor dumping for replay.
Note
MATE_LOGDESTsupports%iin file paths. MATE replaces it with the current process ID.Dumps produced with
MATE_DUMP_SAFETENSORS=1do not preserve original stride or non-contiguous layout information. Use the defaulttorch.saveformat when replay must preserve strides.Level 10 logging writes full API inputs and outputs to disk. Do not enable it for sensitive workloads unless the dump directory is appropriately protected.
JIT, AOT, and Cache¶
Variable |
Default |
Meaning |
|---|---|---|
|
auto-detect visible devices |
MUSA architecture list used by JIT/AOT workflows; accepts space-separated |
|
home directory |
Base directory for the MATE cache workspace. |
|
|
Disable runtime JIT and require matching AOT modules. |
|
|
Show verbose ninja output for runtime JIT builds. |
Runtime loading prefers a matching AOT library when one exists.
MATE_DISABLE_JIT=1 switches to AOT-only behavior and raises an error if no
matching AOT module exists. MATE does not provide an environment variable to
bypass AOT and force runtime JIT when a matching AOT module is present.
Set MATE_MUSA_ARCH_LIST explicitly for offline diagnostics when no MUSA device
is visible:
MATE_MUSA_ARCH_LIST=3.1 mate module-status
MUBIN Artifacts¶
MATE can load MUBIN metadata and kernel artifacts from an installed
mate-mubin package or from a downloaded artifact cache. The following
variables control the downloaded-artifact path and repository behavior.
Variable |
Default |
Meaning |
|---|---|---|
|
|
Root directory for downloaded MUBIN artifacts. Use a directory dedicated to MATE artifacts. |
|
|
Repository name or HTTP(S) URL used as the artifact source. |
|
|
Base URL prepended when |
|
unset |
Disable automatic metadata and kernel downloads when set to any nonempty value. |
|
unset |
Disable kernel-map and object hash verification when set to any nonempty value. |
|
|
Print artifact download, cache reuse, and refresh details when enabled. |
Artifact source precedence is:
An installed
mate-mubinpackage.MATE_MUBIN_DIR, when set.The default
~/.cache/mate/mubindirectory.
An installed mate-mubin package takes precedence even when MATE_MUBIN_DIR
is set. MATE trusts the installed package contents and does not fall back to the
downloaded cache. Without the package, MATE downloads the verified kernel map
when a MUBIN-backed module is first used, then downloads the selected .o
kernel object lazily.
Use mate download-mubin to fetch the complete payload in advance and
mate list-mubins to inspect the active source and module status.
MATE_MUBIN_NO_DOWNLOAD and MATE_MUBIN_VERIFY_DISABLED use nonempty-string
checks. Unset them to restore normal behavior; setting one to 0 still enables
that control.
MATE_MUBIN_DOWNLOAD_VERBOSE uses boolean parsing and treats an empty value,
0, false, no, and off as disabled.
Warning
MATE_MUBIN_VERIFY_DISABLED also disables verification of downloaded .o
objects before MATE loads them. Use the hash bypass only for isolated diagnosis,
not as a persistent deployment setting.
mate env displays the cache, download, verification, and verbosity controls.
Repository and repository-base overrides are not included in that command’s
output; inspect those shell variables directly when diagnosing a custom source.
Runtime Wrapper Controls¶
Variable |
Default |
Meaning |
|---|---|---|
|
|
Override the M-axis padding alignment returned by DeepGEMM wrapper |
Use MATE_DEEPGEMM_MK_ALIGNMENT when DeepGEMM-compatible contiguous grouped
GEMM call sites need a non-default M-axis alignment. Callers should pad each
expert segment and build m_indices using the same value returned by
get_mk_alignment_for_contiguous_layout(). Set this variable before starting
the Python process; the helper reads and caches the value on first use.
Compiler and Build Controls¶
Variable |
Default |
Meaning |
|---|---|---|
|
empty |
Extra host compiler flags for JIT builds. |
|
empty |
Extra |
|
empty |
Extra linker flags for JIT builds. |
|
auto-detected |
Override the |
|
unset |
Build |
MATE JIT builds also honor common build-tool variables such as CXX for the
host C++ compiler and MAX_JOBS for ninja parallelism.
Guard Allocator Debugging¶
Variable |
Default |
Meaning |
|---|---|---|
|
unset |
Internal bootstrap flag used by |
|
unset |
Internal guard allocator mode for bootstrap and replay |
|
unset |
Internal flag controlling device sync before guarded frees |
|
unset |
Internal flag controlling guarded alloc/free logging |
The MATE_GUARD_ALLOCATOR_* variables are internal bootstrap details and are
usually set by MATE itself when preparing guarded child processes. Use
mate guard-run or the Python mate.memory_debug.install_guard_allocator()
API for normal guard allocator debugging. The guard allocator is host-only C++
and does not need MATE_MUSA_ARCH_LIST; that variable only controls MATE
JIT/AOT modules that compile MUSA kernels.
Diagnostic and Test-Only Variables¶
Variable |
Default |
Meaning |
|---|---|---|
|
|
Enable the guarded allocator by default for MATE repository pytest runs |
|
|
Default MATE repository pytest guard allocator mode: |
|
|
Log guarded alloc/free events during MATE repository pytest runs |
|
|
Internal test/diagnostic mode used by MATE tests; not intended as a normal user runtime setting |
|
|
Number of shards to dispatch all the tests to |
|
|
Index of current shard |
|
|
Shard dispatch mode. Currently, only |
When MATE_PYTEST_SHARD_TOTAL > 1, test_fmha.py tests will dominate the last shard.
The MATE_PYTEST_GUARD_* variables are consumed by MATE’s in-repository
pytest conftest.py; they are not installed as a general pytest plugin for
external projects. Prefer mate guard-run for user-facing guarded allocator
debug sessions.