Source: sb3/dqn-LunarLander-v2 from HuggingFace, revision 3f631509a3a70816ba982661e79a1f25f2e617bb
Original Paper/Framework: Stable-Baselines3 DQN with MlpPolicy(net_arch=[256,256]) trained on LunarLander-v2.
Task: Discrete reinforcement-learning policy — LunarLander control.
Observation contract: Box(-inf, inf, (8,), float32) — 8-dim continuous state [x, y, vx, vy, angle, angular_vel, leg_contact_1, leg_contact_2].
Action contract: Discrete(4) — 0:do nothing, 1:fire left engine, 2:fire main engine, 3:fire right engine. Single decision horizon = 1.
Output contract for validation: Q-values tensor shape (1,4) dtype float32 on device npu:0 or cpu, and argmax discrete action 0-3 (deterministic, deterministic=True). Raw logits are compared, not environment reward.
Loading backend: torch with manual QNet reconstruction (SB3 MlpPolicy MLP) + torch_npu for NPU, weights from dqn-LunarLander-v2/policy.pth (545 KB, 276496 bytes param). No trust_remote_code, no custom remote code.
Route mapped to skill: offline-rl (DQN variant mapped to decision-style single-action policy; single-step action plan analogous to DT's last-position action).
sb3/dqn-LunarLander-v2 (stable-baselines3 1.5.1, PyTorch 1.11, Gym 0.21 training). Downloaded via snapshot_download(repo_id="sb3/dqn-LunarLander-v2") respecting HF_ENDPOINT=https://hf-mirror.com (no manual proxy override).q_net.q_net.{0,2,4}.* (Q-network) used for inference; target network weights (q_net_target) preserved in checkpoint but not needed for forward policy.Executed on Ascend910_9362, torch_npu 2.9.0.post1, torch 2.9.0+cpu, npu:0 available (device_count=2).
Fixed observation: [0.0, 0.1, -0.2, 0.5, -0.05, 0.0, 1.0, 0.0] float32 (deterministic, no env sampling randomness).
| Backend | Q-values (shape 1×4) | Device proof | Action |
|---|---|---|---|
| CPU | [33.704620361328125, 34.56105041503906, 25.531845092773438, 32.34321212768555] | cpu | 1 |
| NPU | [33.704612731933594, 34.5610466003418, 25.531841278076172, 32.34320831298828] | npu:0 | 1 |
Synchronized timing (torch.npu.synchronize before/after):
validate_policy_outputs.py --atol 1e-4 --rtol 1e-3 → PASScount=4, finite=true, max_abs=7.63e-06, tolerance=0.03466, passed=trueaction_match: true (both argmax=1)float32, horizon 1, action_dim 4, shape (1,4) validated finite and within bounds.npu:0 for NPU path.10 synchronized samples after 3 warmups, batch=1, horizon=1, dtype=float32:
avg_ms: 0.9149, min_ms: 0.906, max_ms: 0.921, p50: 0.915, p90: 0.919, p95: 0.921, samples: 10
decisions_per_s: ~1093 (actions_per_s identical, horizon=1)Includes only model forward; excludes pre-processing (trivial numpy→tensor). First compile latency reported separately.
CANN 8.5.1, torch_npu 2.9.0.post1, Ascend910 single card (fits, no sharding).policy.pth weights; not retrained on NPU.gym → gymnasium spaces via sys.modules alias) but Q-Network execution is pure PyTorch, not gym-dependent at inference.npu-smi shows 2 devices, run on npu:0; 3110/65536 MB HBM used at test time.pip install -r requirements.txt
python inference.py
# expected: PASS with NPU device proofs


Hardware tag: NPU / Ascend910_9362 verified true NPU.