ankit-sam/LMCache#1 ↔ DongDongJu PoC 포함 여부 분석
질문: PoC 브랜치 fdp-waf-agentic-replay-poc는 ankit-sam/LMCache#1의 변경을 포함하는가?
결론: (d) 미포함, 별도 인프라. 두 브랜치는 같은 dev base에서 분기했지만 commit graph상 ancestry가 없고, 변경 표면도 거의 겹치지 않으며, 같은 NVMe primitive(dspec/dtype/cdw13)를 쓰지만 상위 인터페이스의 추상 수준이 다르다. 단, 핵심 NVMe helper 함수 일부(nvme_uring_cmd_prep 등)는 byte-identical — ankit-sam의 별도 인프라 PR(rust_uring_cmd base)을 PoC가 squash 형태로 흡수한 것으로 보인다.
1. 메타데이터
ankit-sam/LMCache#1
- 제목: "Refine Rust raw block FDP handling and update offload examples"
- State: OPEN, MERGEABLE
- Author: Daegyu Han (한대규) —
daegyu94.han@samsung.com - Repo path:
ankit-sam/LMCache(ankit-sam의 fork에 daegyu94가 PR을 올림) - Head:
9b4014883dc0c92446c0c468b57067ea3a4f6bc8(examples: update rust backend offload FDP options) - Base branch:
rust_uring_cmd(ankit-sam fork의 io_uring_cmd 인프라 브랜치) - 자체 커밋 수: 8 (rust_uring_cmd 위)
- dev에서 본 합산 커밋 수: 15 (= 7 base infra + 8 PR refinements)
- 변경 파일: 6
benchmarks/storage_backend_io/storage_backend_io_benchmark.pyexamples/kv_cache_reuse/local_backends/README.mdexamples/kv_cache_reuse/local_backends/rust_backend_offload.pylmcache/v1/storage_backend/plugins/rust_raw_block_backend.pyrust/raw_block/src/lib.rstests/v1/storage_backend/test_uring_cmd.py
DongDongJu PoC
- HEAD:
35784a3c(benchmarks: add FDP WAF replay stress harness) - dev base:
f8ffd8f0([MP] Introduce EventNotifier #3144) - 자체 커밋 수: 39
- 변경 파일: 95
공통 dev base
두 브랜치 모두 f8ffd8f0에서 분기. ankit-sam rust_uring_cmd도 동일.
2. 검증 방법론
다음 4가지 lens로 포함 여부를 판정.
(1) Commit SHA 매칭
ankit#1의 8개 PR commit SHA와 7개 base commit SHA가 PoC 로그에 있는지.
ANKIT1_PR_SHAS=(8288b6d1 8bb1f36a 79183c87 24ae8ab8 8b7219e1 10812502 2be75bb5 9b401488)
ANKIT_BASE_SHAS=(f031afc3 87097412 48db2d4d 99a8835d e2b171b9 fd7b4aae c91eebb2)
# 두 그룹 모두 0개 매치
for sha in "${ANKIT1_PR_SHAS[@]}" "${ANKIT_BASE_SHAS[@]}"; do
git log f8ffd8f0..dongdongju/fdp-waf-agentic-replay-poc --oneline | grep -c "^$sha"
done
# → 모두 0
결과: SHA 단위 매치 0개. Cherry-pick / merge 형태로 들어오지 않음.
(2) Patch-id 매칭 (squash/rebase 대응)
git patch-id는 author/timestamp/parent를 무시하고 patch content만으로 hash. squash나 rebase로 SHA가 바뀌었어도 patch-id는 동일.
# 각 commit별 patch-id 수집
for sha in $(git log --format='%H' f8ffd8f0..dongdongju/fdp-waf-agentic-replay-poc); do
git show --no-color --pretty=format:'' "$sha" | git patch-id --stable
done > poc_pids.txt # 39개
for sha in $(git log --format='%H' f8ffd8f0..ankit/pr-1); do
git show --no-color --pretty=format:'' "$sha" | git patch-id --stable
done > a1_pids.txt # 15개 (= 7 base + 8 PR)
# 교집합
comm -12 <(cut -d' ' -f1 poc_pids.txt | sort) <(cut -d' ' -f1 a1_pids.txt | sort)
# → 0건
결과: patch-id 교집합 0건. PoC commit 그대로 ankit#1을 흡수하지 않음.
(3) 파일 단위 overlap
PoC 95 파일 ∩ ankit#1 6 파일.
git diff --name-only f8ffd8f0..dongdongju/fdp-waf-agentic-replay-poc | sort > poc_files.txt
git diff --name-only f8ffd8f0..ankit/pr-1 | sort > a1_files.txt
comm -12 poc_files.txt a1_files.txt
공통 파일 (2개):
lmcache/v1/storage_backend/plugins/rust_raw_block_backend.pyrust/raw_block/src/lib.rs
ankit#1의 나머지 4개 파일(benchmarks/storage_backend_io_benchmark.py, examples/local_backends/{README.md, rust_backend_offload.py}, tests/test_uring_cmd.py)은 PoC가 건드리지 않음.
(4) 함수 단위 byte-level 비교
공통 파일 중 rust/raw_block/src/lib.rs의 핵심 함수를 발췌해 직접 비교.
| 함수 | ankit#1 | PoC | 동일성 |
|---|---|---|---|
nvme_ns_size_bytes | 있음 | 있음 | byte-identical |
is_character_device | 있음 | 있음 | byte-identical |
nvme_get_nsid_from_fd | 있음 | 있음 | byte-identical |
nvme_get_lba_shift | 있음 | 있음 | byte-identical |
nvme_get_lba_size | 있음 | 있음 | byte-identical |
nvme_identify_ns | 있음 | 있음 | byte-identical |
nvme_uring_cmd_prep | 있음 (43줄) | 있음 (43줄) | byte-identical |
validate_nvme_directive | 없음 | 있음 (PoC 고유) | — |
nvme_fdp_reclaim_unit_handle_status | 있음 | 없음 | ankit#1만 |
fetch_fdp_status | 있음 | 없음 | ankit#1만 |
# 검증 명령
git show dongdongju/fdp-waf-agentic-replay-poc:rust/raw_block/src/lib.rs | sed -n '/^fn nvme_uring_cmd_prep/,/^}/p' > poc_x.rs
git show ankit/pr-1:rust/raw_block/src/lib.rs | sed -n '/^fn nvme_uring_cmd_prep/,/^}/p' > a1_x.rs
diff -q poc_x.rs a1_x.rs
# → "Files identical"
결론: ankit-sam fork의 rust_uring_cmd base가 추가한 7개 NVMe helper 함수는 PoC와 ankit#1이 동일한 코드로 갖고 있다. 즉 PoC는 ankit-sam의 인프라를 patch 형태로 흡수했다 (squash, 또는 별도 author/timestamp로 재커밋).
3. 인터페이스 추상 수준 차이 (FDP 영역)
같은 NVMe primitive(cmd.cdw12 |= dtype, cmd.cdw13 = (dspec << 16))를 쓰지만 상위 API 모양이 다르다.
ankit#1 (Daegyu, refinement)
위치: lmcache/v1/storage_backend/plugins/rust_raw_block_backend.py:91-207, rust/raw_block/src/lib.rs:1568(fetch_fdp_status)
self.use_fdp: bool = bool(extra.get("rust_raw_block.use_fdp", False))
if self.use_fdp:
self._configure_fdp_placements()
# _configure_fdp_placements:
# 1. fdp_status = self._fetch_fdp_status() # Rust 호출
# 2. placement_ids = [pid for pid, _ruhid in fdp_status]
# 3. self._data_placement_id = self._assign_fdp_placement_rank_based(placement_ids)
# → 단일 data_placement_id로 통합 (per-write rank → 단일 ID 사용)
특징:
- NVMe identify로 RUH descriptor를 직접 읽고, 그 결과로 placement_id를 자동 결정
- placement는 rank-based 단일 ID (모든 데이터 write가 동일 RUH로)
- 메타데이터는 default RUH (FDP directive 없음)
- 보수적 / fail-fast: FDP 활성화 시 namespace가 status를 못 주면 즉시 에러
PoC (DongDongJu / Dongjoo Seo)
위치: lmcache/v1/storage_backend/raw_block/core.py:82-225, :342-408
@dataclass
class RawBlockCoreConfig:
use_fdp: bool = False
fdp_data_ruh_ids: tuple[int, ...] = ()
fdp_metadata_ruh_ids: tuple[int, ...] = () # ← 별도 pool
fdp_directive_type: int = 2
fdp_metadata_mode: str = "per_ruh"
class RawBlockCore:
def _select_fdp_ruh(self, key, obj=None) -> int | None:
# 3단 fallback: obj.metadata.fdp_placement_rank > kv_rank>>16 > worker_id
idx = worker_index % len(self.fdp_data_ruh_ids)
return self.fdp_data_ruh_ids[idx]
def _select_fdp_metadata_ruh(self, encoded_key) -> int | None:
digest = blake2b(encoded_key)[:8]
idx = digest % len(self.fdp_metadata_ruh_ids)
return self.fdp_metadata_ruh_ids[idx]
특징:
- RUH ID 리스트(설정으로 N개) + per-key/per-worker 분배
- data RUH pool과 metadata RUH pool 완전 분리 (commit
f3a4297a핵심) - placement rank 결정 3단 fallback (rank stamp → key bits → legacy worker_id)
validate_nvme_directive함수로 dspec/dtype 정합 검증fetch_fdp_status같은 device introspection은 하지 않음 — 사용자가 RUH ID 직접 명시 (실패 시 namespace 측 에러)
4. 4지선다 결론
| 옵션 | 판정 | 근거 |
|---|---|---|
| (a) 그대로 포함 (commit SHA 동일) | ✗ | SHA 매치 0건, ancestry 없음 |
| (b) cherry-pick으로 포함 (patch-id 동일, SHA 다름) | ✗ | patch-id 교집합 0건 |
| (c) 변형 후 포함 (같은 의도를 다른 코드로 재작성) | △ | 일부만 — NVMe helper 7개 함수는 byte-identical. 인프라는 squash로 흡수, FDP API 자체는 독립 작성 |
| (d) 미포함, 별도 인프라 | ✓ | ankit#1의 FDP 핵심 (fetch_fdp_status, rank-based 단일 ID, _configure_fdp_placements)는 PoC에 존재하지 않음. PoC는 dspec list + per-key worker 분배 + data/metadata 분리라는 다른 설계로 갔다 |
최종 판정: (c) + (d) 혼합 — io_uring_cmd 코어 인프라(NVMe helper 7개 함수, nvme_uring_cmd_prep)는 ankit-sam의 rust_uring_cmd 브랜치에서 PoC로 squash 흡수됨 (byte-identical). 그러나 그 위에 쌓은 FDP 사용자 API와 정책은 두 라인이 독립.
5. 인프라 동등성 정리표
| 영역 | ankit-sam #3274 (dev에 머지된/예정) | ankit#1 (rust_uring_cmd base) | PoC |
|---|---|---|---|
| io_uring 커널 ABI | bf7d2ff1 머지본에 존재 | base에 존재 | byte-identical로 흡수 |
NVMe helper 7개 (nvme_identify_ns, nvme_uring_cmd_prep 등) | 있음 | 있음 | 있음 (byte-identical) |
validate_nvme_directive | 없음 | 없음 | PoC 고유 |
fetch_fdp_status (RUH descriptor 자동 조회) | 없음 | 있음 | 없음 |
| FDP policy 추상 | — | rank-based 단일 ID | data/metadata 분리 + N-RUH list |
| Python config 키 | — | rust_raw_block.use_fdp/use_uring_cmd (extras) | L2 adapter JSON: use_fdp/fdp_data_ruh_ids/fdp_metadata_ruh_ids/fdp_directive_type/fdp_metadata_mode |
| 메타데이터 처리 | — | default RUH (no FDP) | per_ruh mode (메타데이터도 FDP, 별도 pool) |
| 빌드 사전조건 | dev에 머지됨 | rust_uring_cmd 머지 후 가능 | self-contained (PoC가 인프라까지 들고 옴) |
| 테스트 | tests/test_rust_raw_block_backend.py 일부 | tests/test_uring_cmd.py | tests/test_rust_raw_block_backend.py +507줄 (FDP directive 검증 포함) |
6. 단계 5 시사점 (05_design/에서 참조)
- 인프라(NVMe helper) 통합: 두 라인이 byte-identical하므로 dev의 #3274 머지본 이후엔 자연스레 합쳐짐. 추가 코드 차이 없음.
- FDP API 통합 결정 필요: PoC의 N-RUH list + data/metadata 분리 vs ankit#1의 rank-based 단일 ID —
daegyu94_integration.md에서 어느 추상을 upstream에 채택할지 결정. 현재 메모상 ankit#1이placement_ids[0]기본을 쓴다는 것은 list 인터페이스로의 super-set 매핑이 가능하다는 뜻이다. fetch_fdp_status채택 필요: ankit#1만 RUH descriptor 자동 조회를 갖고 있다. PoC식 "사용자가 RUH ID 직접 명시"는 운영 친화도가 낮음 → ankit#1의 introspection 패턴을 가져오는 것이 합리적.- PoC의 metadata-RUH 분리(
fdp_metadata_mode="per_ruh")는 upstream 채택 후보: 체크포인트 메타데이터의 lifetime이 데이터와 다르므로 별도 RUH가 WAF에 직접 영향 (commitf3a4297a의도). 단계 4 측정으로 효과 입증 시 PR-A의 일부. - PoC의 3단 fallback placement rank 결정(
obj.metadata.fdp_placement_rank>kv_rank>>16> legacyworker_id)은 daegyu94의 단일 ID로는 표현 불가 → API 확장 필요.
7. 검증 명령 묶음 (재현용)
cd /home/ny/private/LMCache
# 1. Remote 상태 확인
git remote -v
# origin https://github.com/LMCache/LMCache.git
# dongdongju https://github.com/DongDongJu/LMCache.git
# ankit https://github.com/ankit-sam/LMCache.git
# 2. PR1 head fetch (이미 fetch됨)
git fetch ankit refs/pull/1/head:refs/remotes/ankit/pr-1
# 3. SHA / patch-id / file overlap 검사
git log --oneline f8ffd8f0..dongdongju/fdp-waf-agentic-replay-poc | wc -l # 39
git log --oneline f8ffd8f0..ankit/pr-1 | wc -l # 15
git diff --name-only f8ffd8f0..dongdongju/fdp-waf-agentic-replay-poc | wc -l # 95
git diff --name-only f8ffd8f0..ankit/pr-1 | wc -l # 6
# 4. 핵심 함수 동일성
git show dongdongju/fdp-waf-agentic-replay-poc:rust/raw_block/src/lib.rs \
| sed -n '/^fn nvme_uring_cmd_prep/,/^}/p' > /tmp/poc.rs
git show ankit/pr-1:rust/raw_block/src/lib.rs \
| sed -n '/^fn nvme_uring_cmd_prep/,/^}/p' > /tmp/a1.rs
diff -q /tmp/poc.rs /tmp/a1.rs # → identical