Dreaming Bird 是一个基于 decoder-only transformer 的 Flappy Bird 世界模型。给定最近的游戏帧和玩家动作(扇动/不扇动),模型自回归生成下一帧的量化状态。以约 30-60 fps 循环运行时,模型取代了物理引擎——运行时不存在游戏逻辑,网络本身就是物理系统。
small_pipes.pt(完整管道游戏模型)| 项目 | 值 |
|---|---|
| NPU | Ascend 910B (Ascend910_9362) |
| CANN | 8.5.1 |
| PyTorch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1 |
| Python | 3.11.14 |
pip install torch torch_npu numpy# 下载检查点
python3 -c "from huggingface_hub import snapshot_download; snapshot_download('gmmeyer/gpt-bird', local_dir='.')"
# 运行推理
python inference.py --checkpoint small_pipes.pt --frames 100在 Ascend 910B NPU 上运行 100 帧自回归生成:
Frames generated: 99
Total time: 1.508s
FPS: 65.6
Final state: bird_y=354.00, pipe_dx=11.25, gap_y=104.00, alive=False (died at frame 99)采样帧:
Frame 1: bird_y= 258.00, pipe_dx= 222.75, gap_y= 296.00, alive=True
Frame 10: bird_y= 322.00, pipe_dx= 186.75, gap_y= 296.00, alive=True
Frame 28: bird_y= 346.00, pipe_dx= 114.75, gap_y= 296.00, alive=True
Frame 55: bird_y= 318.00, pipe_dx= 6.75, gap_y= 296.00, alive=True, action=FLAP
Frame 73: bird_y= 270.00, pipe_dx= 114.75, gap_y= 104.00, alive=True
Frame 91: bird_y= 322.00, pipe_dx= 42.75, gap_y= 104.00, alive=TrueCPU 和 NPU 的前向传播输出完全一致(相同 logits),验证了模型在 NPU 上的数值正确性。
| 指标 | 值 |
|---|---|
| 推理帧数 | 99 |
| 总耗时 | 1.508s |
| FPS | 65.6 |
| 每帧耗时 | ~15.2ms |
| 实时能力 | 60+ FPS (超过 30fps 实时阈值) |
