Nodes/ComfyUI-Ascend-Int8-Test/Ascend INT8 Environment Report
ComfyUI Node

Ascend INT8 Environment Report

Did torch_npu actually load? Ask before you trust anything

By Aucannot·Created 3 months ago·Updated 3 months ago· 0
Ascend INT8 Environment Report
    • report
    probe_torch_nputrue

    The whole Ascend INT8 pipeline in this pack depends on one thing being importable, and on a fresh install it often isn't: torch_npu, the PyTorch backend for Huawei's Atlas cards. If it's missing, the loader nodes don't crash - they quietly fall back to dequantized math and you'd never know why nothing got faster. The Ascend INT8 Environment Report is the three-second health check you run before you trust any of it.

    Drop it into an empty workflow, hit Queue, and it prints one report with the details that matter:

    • Python, torch, and torch_npu versions (plus the torch CUDA version, a tell that this pack was smoked-tested on a hybrid box)
    • torch.npu.is_available, device count, and the NPU name if a device is present
    • Whether the three INT8 APIs the pack depends on exist: npu_weight_quant_batchmatmul, npu_anti_quant, and torch_npu.contrib.module.LinearWeightQuant

    How it works is refreshingly boring: it imports torch_npu behind a guard so a missing install becomes a not importable: ModuleNotFoundError line instead of a crash, pokes torch.npu.* if the attribute exists, and reports each op as present or absent. The one bit of cleverness is internal - the node returns float("NaN") from IS_CHANGED, the standard always-rerun trick, so it never hands you a stale cached report. Every run is fresh, which is exactly what you want from a diagnostic.

    Inputs and outputs are minimal. The only input, probe_torch_npu (on by default), controls whether it attempts the torch_npu imports at all - leave it on; turning it off just silences the noise when you already know torch_npu isn't there. The single output, report, is a STRING that renders in the node's own text box. You can wire it into a Show Text or any string consumer, but most people just read it.

    Installing the pack is a one-liner - via ComfyUI Manager (search "ComfyUI-Ascend-Int8-Test") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Aucannot/ComfyUI-Ascend-Int8-Test
    

    then restart ComfyUI. There's no requirements.txt and no model download: the pack only needs ComfyUI core plus, for the real INT8 path, torch_npu itself - which in turn expects Huawei's CANN runtime underneath on the box.

    Reading the output: the line you care about is npu_weight_quant_batchmatmul: True. If it's False, or torch_npu shows not importable, the loaders will fall back to dequantized weights and you'll get correct images with zero speed benefit - go install the Ascend stack first. If torch_npu imports fine but torch.npu.is_available is False, the package is there and the driver/runtime isn't up yet.

    One honest note: if you don't know what an Ascend NPU is, this node (and this whole pack) isn't for you. It's deployment-validation tooling for ComfyUI on Huawei Atlas hardware, not a speed hack for your RTX card.

    Categoryascend/int8

    Inputs (1)

    NameTypeDefaultDescription
    probe_torch_npuBOOLEANtrue

    Outputs (1)

    NameTypeDescription
    reportSTRING