This directory is a complete, reproducible Ascend NPU inference candidate for the
pinned upstream model
Tunamelon/ppo-LunarLander-v2.
f0b8ee438f823e7bbadf44d71821cd5c7257a4c1ppo-LunarLander-v2.zip — 107482 bytes — SHA256
bd190ac3821a73c129245953571ef81a60a9905039328c6d7c45ae3fab9e686ePPO with MlpPolicy (ActorCriticPolicy,
share_features_extractor=False, custom 9 → 64 → 64 feature extractor).torch_npu (torch 2.9.0+cpu + torch_npu 2.9.0, CANN-matched).npu:4 (Ascend910B4-1).action=1, value=0.093002,
log_prob=-1.380901.The policy/model forward runs wholly on npu:4. The CPU only orchestrates Python,
deserializes the checkpoint, and preprocesses the observation. There is no CPU offload
and no CPU fallback; any NPU initialization, placement mismatch, or execution error makes
the process exit nonzero.
| Field | Value |
|---|---|
| Model ID | Tunamelon/ppo-LunarLander-v2 |
| Source | https://huggingface.co/Tunamelon/ppo-LunarLander-v2 |
| Pinned revision | f0b8ee438f823e7bbadf44d71821cd5c7257a4c1 |
pipeline_tag | reinforcement-learning |
library_name | stable-baselines3 |
| NPU tags | ascend, npu, torch_npu, hardware: NPU |
| Algo / policy | PPO / MlpPolicy (ActorCriticPolicy, MLP [64, 64]) |
| Observation space | Box(shape=(8,), float32) (LunarLander-v2) |
| Action space | Discrete(4) (none / left engine / main engine / right engine) |
| Reported reward | mean_reward = 301.34 +/- 16.08 (model-index, from upstream card) |
The upstream model card declares no license field in its YAML front matter. This was
verified directly from the upstream model card (Tunamelon/ppo-LunarLander-v2 README front
matter contains library_name: stable-baselines3 and tags, but no license key) on
2026-08-22. Accordingly the front matter above uses license: other to denote a
non-standard / undeclared license, and the upstream card's own tag set is preserved. The
weights are treated as license-not-declared; the Stable-Baselines3 library itself is
MIT-licensed, but that does not license the model weights. Do not assume a permissive license
for redistribution without upstream confirmation.
Tested in this container (/root/ascend-model-pipeline/jobs/rl26/ppo-lunarlander-v2/ppo-lunarlander-v2-npu):
| Component | Version / value |
|---|---|
| OS | Linux 5.10.0 (openEuler, aarch64) |
| Python | 3.11.14 |
| CANN | 8.5.1 |
| torch | 2.9.0+cpu (image-provided, CANN-matched — do not replace) |
| torch_npu | 2.9.0 (image-provided, CANN-matched — do not replace) |
| stable-baselines3 | 2.7.0 |
| gymnasium | 1.2.0 |
| numpy | 1.26.4 |
| cloudpickle | 3.1.2 |
| npu-smi | 25.5.1 |
| Hardware | Ascend910B4-1 (8 devices; this candidate uses physical npu:4) |
requirements.txt intentionally lists only non-torch runtime dependencies. The
CANN-matched torch / torch_npu pair is pre-installed in the image and must never be
replaced by ordinary PyPI wheels.
All pip installs below use the Aliyun PyPI mirror only:
# 1. Load the CANN environment (idempotent).
source /usr/local/Ascend/ascend-toolkit/set_env.sh
# 2. Install only the non-torch runtime dependencies from Aliyun.
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/Equivalently, pin the mirror for the whole shell:
export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
pip install -r requirements.txt⚠️ Never install
torchortorch_npufrom PyPI. They are provided by the image as a CANN-matched pair (torch 2.9.0+cpu+torch_npu 2.9.0) and must stay untouched.
# 1. Load the CANN environment (required for NPU runtime).
source /usr/local/Ascend/ascend-toolkit/set_env.sh
# 2. Sanity-check the NPU devices.
npu-smi info
# 3. Run the deterministic NPU inference (device npu:4, 8 s hold window for npu-smi
# PID correlation; log is teed to logs/npu_inference.log).
cd /root/ascend-model-pipeline/jobs/rl26/ppo-lunarlander-v2/ppo-lunarlander-v2-npu
MODELAGENT_HOLD_SECONDS=8 python3 inference.py
# 4. Inspect the structured result.
cat logs/npu_result.jsoninference.py sources nothing implicitly; step 1 loads the CANN runtime. The physical device
mapping keeps ASCEND_RT_VISIBLE_DEVICES at its default (0,1,2,3,4,5,6,7) so npu:4 ==
physical device 4. The script exits with the Python exit code (0 on success, 1 on any error or
placement mismatch).
Command:
cd /root/ascend-model-pipeline/jobs/rl26/ppo-lunarlander-v2/ppo-lunarlander-v2-npu && MODELAGENT_HOLD_SECONDS=8 python3 inference.pyExit code: 0. PID: 3810798 (correlated live with npu-smi on physical npu:4).
Actual output (logs/npu_inference.log, verbatim excerpts):
2026-08-22 09:30:43,447 INFO checkpoint path=/work/pipeline/models/rl26/ppo-lunarlander-v2/ppo-LunarLander-v2.zip size=107482 sha256=bd190ac3821a73c129245953571ef81a60a9905039328c6d7c45ae3fab9e686e
2026-08-22 09:30:44,870 INFO torch.npu.is_available()=True device_count=8 current_device=4 name=Ascend910B4-1
2026-08-22 09:30:46,033 INFO loaded complete real policy.pth: 24 weight/bias tensors
2026-08-22 09:30:46,050 INFO model device=npu:4 params=31365 all_params_on_npu=True
2026-08-22 09:30:46,167 INFO [MODELAGENT] READY pid=3810798 device=npu:4 marker=.../logs/npu_ready.pid
2026-08-22 09:30:46,167 INFO holding 8.0s so an external wrapper can correlate PID with npu-smi
2026-08-22 09:30:46,696 INFO npu-smi proc-mem (live, during hold) pid=3810798:
NPU ID : 4
Process id:3810798 Process name:python3 Process memory(MB):116
2026-08-22 09:30:54,845 INFO deterministic action=1 value=0.093002 log_prob=-1.380901
2026-08-22 09:30:54,845 INFO probs=[0.247267, 0.251352, 0.251339, 0.250042]
2026-08-22 09:30:54,845 INFO logits=[-1.397286, -1.380901, -1.380952, -1.386126]
2026-08-22 09:30:58,088 INFO wrote .../logs/npu_result.json
2026-08-22 09:30:58,089 INFO MODELAGENT DONE exit=0 pid=3810798 action=1 value=0.093002 log_prob=-1.380901 elapsed=0.1475sThe same npu_inference.log also records the live PID correlation in the sanitized raw
npu-smi info snapshots (before and after the forward, physical device 4):
| 4 0 | 3810798 | python3 | 114 |
...
| 4 0 | 3810798 | python3 | 144 |Key result values (all on npu:4):
| Output | Value | Shape | dtype |
|---|---|---|---|
action | 1 | [1] | int64 |
value | 0.09300198405981064 | [1, 1] | float32 |
log_prob | -1.3809013366699219 | [1] | float32 |
probs | [0.247267, 0.251352, 0.251339, 0.250042] | [1, 4] | float32 |
logits | [-1.397286, -1.380901, -1.380952, -1.386126] | [1, 4] | float32 |
Placement evidence in logs/npu_result.json (top level): engine: torch_npu,
npu_available: true, npu_device_name: Ascend910B4-1, source_revision: f0b8ee438…,
input_device: npu:4, model_device: npu:4, output_device: npu:4,
logits_device: npu:4, exit_code: 0. The top-level output object carries the
meaningful model output (action, value, log_prob, probabilities, logits),
each with its value(s), shape, device (npu:4) and dtype, alongside the
result / placement sections.
Rendered from the real final transcript / sanitized log / result JSON (no fabricated values):
assets/agent_workflow.png — agent workflow: read-only upstream routing, pinned-revision
checkpoint verification, NPU init, NPU forward, and result JSON.assets/npu_device_call.png — live npu-smi device / process call on physical npu:4
(PID correlation during the hold window).assets/model_result.png — final model result: action / value / log_prob, shapes, devices,
versions, timing and PID.assets/modelagent_live_session.png — sanitized excerpts from the real ModelAgent review
conversation, followed by the independently rerun final PID and acceptance result.torch_npu casts double tensors to float32
and emits a non-fatal [W822] warning during the first forward. Outputs are correct float32.learning_rate / clip_range / lr_schedule as Python code objects that cannot be
cloudpickled under Python 3.11. These are training-time hyperparameters (not weights); this
candidate deserializes the complete real policy.pth (all 24 weight/bias tensors) and
re-assembles the exact SB3 ActorCriticPolicy topology, so the policy forward is faithful.PPO warns that it is "primarily intended to run on the CPU"
when placed on a non-CPU accelerator during training; this candidate intentionally runs
inference on NPU.npu:4. On another host with a
different ASCEND_RT_VISIBLE_DEVICES mapping, verify npu:4 still selects the intended
physical device./work/pipeline/models/rl26/ppo-lunarlander-v2/ppo-LunarLander-v2.zip); it is not copied
into this delivery.