This is an Ascend NPU-adapted deployment for PaulVialard/ppo-Huggy (PPO on Huggy Unity ML-Agents, reinforcement-learning).
1fd517574882e4b765aa24a2b078d91fa1ab9072Clip(mu,-3,3)/3 -> normalized [-1,1] continuous 21-Doffline-rl (PPO continuous decision, closest to Decision Transformer contract: state 59 -> action 21, horizon=1)npu:0 with synchronized timing and CPU-NPU consistency validationModel and tensors are explicitly placed on npu:0 and verified:
next(policy.parameters()).device == npu:0policy.running_mean.device == npu:0input obs Tensor device == npu:0action device == npu:0, mu device == npu:0Synchronization uses torch.npu.synchronize() before/after timing.
[0.11,0.09,0.53,0.48,0.0,...]):
[[0.0071, -0.0292, 0.0047, ... 0.0158], ...] batch=4, shape [4,21]2.2e-07 (< 1.1e-03 tolerance = atol 1e-4 + rtol 1e-3 * max_ref), mean-abs 3.8e-081.9e-06Huggy-2000049.pt 13.5 MB), fp32torch.npu.synchronize() around each timed forwardValidated on Ascend 910 (2x NPU, ~61 GiB free per card, torch_npu 2.9.0.post1, CANN 8.5.1).
import torch, torch_npu
from pathlib import Path
# policy automatically downloads checkpoint from HuggingFace if not present
ckpt = torch.load("Huggy-2000049.pt", map_location="cpu")
# Build HuggyPolicy as in inference.py and move to npu:0
# obs: tensor shape [B,59] float32 normalized via running stats
# action, mu = policy(obs) -> deterministic action = Clip(mu)/3 in [-1,1]See inference.py for full synchronized example with device proof and batch 4.

inference.py - NPU inference with device proof, consistency and perfrequirements.txt - dependenciesassets/*.png - xterm.js evidence screenshotslog_sigma not used for validation (CPU/NPU would diverge on random noise)