r/MachineLearning: GraphZero, mmap과 zero-copy tensor로 대형 graph를 RAM 없이 다루는 C++ engine

Original: [P] I got tired of PyTorch Geometric OOMing my laptop, so I wrote a C++ zero-copy graph engine to bypass RAM entirely. View original →

Read in other languages: English日本語
AI Mar 17, 2026 By Insights AI (Reddit) 1 min read Source

GNN의 memory wall을 system design으로 우회하려는 시도

2026년 3월 15일 r/MachineLearning에서는 GraphZero v0.2 self-post가 334 points와 27 comments를 모았다. 작성자는 Papers100M 같은 large graph dataset를 다룰 때 PyTorch Geometric가 edge list와 feature matrix를 올리려다 곧바로 24GB+ OOM을 일으키는 경험에서 출발했다고 설명한다. 그래서 dataset 전체를 RAM에 적재하는 대신, SSD 위 데이터 구조를 operating system의 page cache와 page fault 메커니즘으로 직접 활용하는 C++ engine을 만들었다.

post에 따르면 GraphZero는 raw CSV를 두 개의 custom binary format으로 변환한다. topology는 .gl, feature matrix는 .gd로 저장한다. 이후 POSIX mmap으로 파일을 직접 memory-map하고, nanobind를 이용해 raw pointer를 NumPy와 PyTorch 쪽으로 zero-copy array처럼 넘긴다. training loop 안에서 model은 마치 50GB tensor가 RAM에 있는 것처럼 보지만, 실제로는 batch가 접근한 4KB page만 NVMe에서 필요한 순간에 로드된다. 작성자는 여기서 OpenMP 기반 multi-thread neighbor sampling과 GIL 해제를 더해 disk I/O, CPU sampling, GPU math를 동시에 겹치게 했다고 설명한다.

GitHub README의 benchmark 수치도 꽤 공격적이다. GraphZero는 repo README에서 ogbn-papers100M을 예시로 들며 111 Million nodes, 1.6 Billion edges 규모의 graph를 consumer laptop에서 다루는 것을 목표로 삼는다. 여기서 raw 30GB CSV를 13GB binary로 줄이는 compressed CSR 형태를 사용하고, 16GB RAM Windows laptop에서 peak RAM usage를 약 5.1GB OS cache 수준으로 유지했다고 주장한다. 같은 workload에서 PyTorch Geometric는 24.1GB 이상이 필요해 crash했고, GraphZero는 0.000000초 load time과 1,264,000 steps/s random walk throughput을 제시한다.

이 프로젝트가 흥미로운 이유는 GNN 확장의 문제를 model architecture보다 systems problem으로 다시 정의하기 때문이다. 큰 graph를 다루기 위해 더 비싼 server를 사는 대신, data layout, file format, memory mapping, sampling pipeline을 바꿔 접근하겠다는 발상이다. benchmark 수치는 추가 검증이 필요하겠지만, community가 강하게 반응한 이유는 분명하다. consumer hardware에서도 large graph experiment를 해볼 수 있다는 제안은 graph ML 실무와 연구 모두에서 즉시 체감되는 가치가 있다.

Primary source: GraphZero GitHub repository. Community discussion: r/MachineLearning.

Share: Long

Related Articles

Comments (0)

No comments yet. Be the first to comment!

Leave a Comment

© 2026 Insights. All rights reserved.