Index
2026-05-14 — Experiment

LoRA V2 학습 + Cascade Adapter 구현

memer | Tier-1 vocab swap · 3-venv subprocess IPC

TL;DR

0.0111
eval_loss
0.998
token_acc
4m49s
학습 시간
~550L
cascade LoC
5
retry 횟수

1 배경 / 목적

260513 세션에서 Tier-1 데이터 빌더와 LoRA 학습 스크립트를 작성했지만, SLURM job은 queue에 PENDING 상태였다. 이번 세션의 목표는 세 가지였다:

기존 한계: dusting MemER가 RoboCasa 환경에서 "place X on top/bottom shelf"만 출력 (vocab lock-in). Pi0.5와 cascade하려면 RoboCasa atomic format("pick the X from Y and place it in Z")이 필수.

2 작업 내용

V1 echo bug 발견 및 V2 수정

V1 probe 결과: 모든 test에서 n_unique=1, 출력이 input query를 그대로 복사. 원인은 학습 데이터에서 task_goal == current_subtask로 동일 string이 들어간 것. 모델이 trivially copy를 학습한 것.

# V1 (실패) — trivial copy messages[user]: "... The task goal is: pick the fish from the counter..." messages[assistant]: {"current_subtask": "pick the fish from the counter..."} # → input = output → token_acc=1.0이 trivially 만족 # V2 (수정) — derive_task_goal()로 분리 "pick the X from Y and place it in Z" → "Show me where the X is placed." "navigate to the X" → "Where should the robot navigate?" "open the X" → "What should the robot open?" # 이제 모델이 image를 봐야 current_subtask를 맞출 수 있음

LoRA 학습 5회 재시도

Job소요실패 원인Fix
24481m49srelative path — images/ep000175/... 못 찾음train.jsonl absolute path 변환
24351h+ModelScope 200kB/s 극단적으로 느림export USE_HF=1
25872m35storch.optim.lr_scheduler ValueError: zip() strict=True — torch 2.11 + transformers 4.57 + deepspeed combo bugdeepspeed 제거 (LoRA r=16엔 ZeRO-2 불필요)
25894m55sV1 — 학습은 성공하나 echo bugV2 데이터 재빌드
25904m49s✅ V2 학습 완료

cascade adapter 구현 (3 files, ~550L)

torch / jax / robocasa가 한 venv에 공존 불가 → 3-process 분리 설계:

[ robocasa env (Python 3.11) ] └── eval_runner.py → MemerPi05Policy(BasePolicy) ├── subprocess.Popen(memer_worker.py) # memer env, stdin/stdout JSON RPC └── subprocess.Popen(pi05_worker.py) # sister .venv (jax), stdin/stdout JSON RPC # IPC 프로토콜 (line-delimited JSON) IN: {"op": "load" | "reset" | "step" | "ping" | "shutdown", ...} OUT: {"ok": true, "current_subtask": "...", "predicted_keyframe_positions": [...], ...} # PI05_STUB=1 env var → zero action mode (cascade 동작 먼저 검증)
ping 검증: memer_worker → {"ok":true,"worker":"memer","ready":true} ✅ / pi05_worker(stub) → {"ok":true,"worker":"pi05","stub_mode":true}

3 결과

V2 학습 수렴

Steptrain_losstoken_acc
12.1450.763
250.5090.917
500.0430.985
1000.0110.996
108 (eval)0.01110.998

V1: train_loss 2.18e-6 (trivial copy). V2: 의미 있는 학습 진행.

vocab probe — combo_002 × 3 tests (103 calls/test)

Test정답 fixturetop 출력 패턴unique 수format 정합
steakfreezer"pick the steak from the {cabinet/sink/pan} and place it in/on Y"20
bowlcabinet"pick the bowl from the {counter/cabinet} and place it in {sink/cabinet/counter}"11
fishoven"pick the fish from the {cabinet/counter} and place it on/in Y"17
vocab swap 성공: RoboCasa atomic format으로 정확히 출력. Pi0.5 cascade interface 호환성 확보.
target fixture 정확도 부족: 시각적으로 보이는 fixture로 추측 — steak→freezer X, bowl→cabinet ?, fish→oven X. Tier-1은 single-atomic 학습이라 memory FIFO를 활용 못함. Tier-2 필요.

4 Takeaway

V1 trivial copy 버그가 핵심 교훈

데이터 설계 시 user prompt와 assistant 출력이 너무 가까우면 모델이 copy를 학습한다. token_acc=1.0이 오히려 버그의 신호였다. derive_task_goal()로 task_goal ≠ current_subtask를 보장해야 진짜 학습이 가능.

deepspeed는 LoRA에 불필요

torch 2.11 + transformers 4.57 + deepspeed 조합의 lr_scheduler.zip() strict=True 버그. LoRA r=16 4B 모델에는 ZeRO-2 없이 plain DDP(4 GPU, effective batch 16)로 충분하고 오히려 빠름.

3-venv IPC 패턴 성립

torch / JAX / robocasa sim을 한 프로세스에 담는 것은 불가능하다. subprocess + line-delimited JSON RPC로 각 venv를 완전히 분리하고 orchestrator가 stdin/stdout으로 조율하는 패턴이 이 프로젝트의 기반 인프라가 됨.

5 Next Steps

scene-mem env 완성 (asset blocker)

이 세션 당시 objects_lightwheel.zip이 nvidia HF에서 404로 내려가 Stool013을 받지 못해 scene-mem env load가 90% 상태로 막혔다. utexas Box 대안이나 robocasa main branch 전환으로 해결 필요. → 후속 세션(260514 낮)에서 해결됨.

Tier-2 학습으로 target fixture 정확도 개선

Tier-1은 single-atomic 1 episode → keyframe 1개라 scene 전체 memory recall이 불가능. compound trajectory + memory FIFO를 학습 데이터에 포함하는 Tier-2 builder + 학습 필요.

실제 Pi0.5 cascade 검증

PI05_STUB=0으로 전환하면 실제 mme_vla_suite config 매핑, norm_stats 로딩, 32-dim action chunk → env.action_dim 트리밍 검증이 필요.