#!/bin/bash set -e # 预热 torch inductor,避免推理时编译 python -c " import torch @torch.compile(mode='reduce-overhead') def _warmup(x): return x * 2 x = torch.randn(100, 100, device='cuda') _warmup(x) print('Inductor cache ready') " echo "build env success"