NVIDIA开源Kumo Engine:基于NVMe训练大规模图神经网络
NVIDIA Open-Sources Kumo Engine to Train GNNs on Relational Databases
做推荐或风控的同学必看,它解决了大图无法装入内存的痛点,实测性能提升显著且代码可直接复用。
NVIDIA has open-sourced NVIDIA Kumo Engine, an engine for training predictive models directly on relational data. Kumo Engine is an Apache 2.0 accelerator that stores linked tables as an on-disk graph. For each entity, it samples related records up to the prediction time. Its Rust core, DiskGraph, reads those neighborhoods from local NVMe SSDs instead of RAM. The current PyPI release is kumo-engine 1.2.0.
NVIDIA 开源了 NVIDIA Kumo Engine,这是一个直接在关系数据上训练预测模型的引擎。Kumo Engine 是一个 Apache 2.0 许可的加速器,它将链接表存储为磁盘上的图结构。对于每个实体,它会采样直到预测时间点的相关记录。其 Rust 核心 DiskGraph 从本地 NVMe SSD 而不是 RAM 中读取这些邻域。当前的 PyPI 版本是 kumo-engine 1.2.0。
TL;DR
TL;DR(太长不看)
- Size: Tested on a 50B-node commerce graph with 175.5B edges (reverse edges included). Its 2.6 TiB index exceeded the machine’s 1 TiB RAM.
- Runs on: Linux with local NVMe and an NVIDIA GPU for production. Small datasets also run on CPU or Apple silicon. Python 3.11+.
- Performance: 2.4x to 8.9x faster warm neighborhood retrieval than prepared DuckDB 2.0.0 at 2 to 4 hops.
- Best: 2-hop retrieval at 5.3 s per million seeds vs 46.9 s for prepared DuckDB.
- Worst: 63.26% test accuracy vs 63.93% for in-memory PyG, 0.67 points lower.
- 规模:在包含 500 亿个节点和 1755 亿条边(含反向边)的商业图上进行了测试。其 2.6 TiB 的索引超过了机器 1 TiB 的 RAM 容量。
- 运行环境:生产环境需要 Linux、本地 NVMe 和 NVIDIA GPU。小型数据集也可以在 CPU 或 Apple Silicon 上运行。支持 Python 3.11+。
- 性能:在 2 到 4 跳范围内,预热邻域检索速度比准备好的 DuckDB 2.0.0 快 2.4 倍至 8.9 倍。
- 最佳表现:每百万种子节点的 2 跳检索时间为 5.3 秒,而准备好的 DuckDB 为 46.9 秒。
- 最差表现:测试准确率为 63.26%,而内存中的 PyG 为 63.93%,低了 0.67 个百分点。
What problem does Kumo Engine solve?
Kumo Engine 解决了什么问题?
Most enterprise data lives in connected tables. Customers link to orders, and orders link to products.
大多数企业数据都存储在关联表中。客户链接到订单,订单链接到产品。
Classic ML pipelines flatten those tables first. Engineers write joins and aggregates like “orders in the last 30 days.” The model then sees only that summary.
经典机器学习流水线首先将这些表展平。工程师编写连接和聚合操作,例如“过去 30 天的订单”。然后模型只能看到这些摘要信息。
Graph learning keeps the structure. Each row becomes a node and each foreign key becomes an edge. The hard part is scale. One prediction needs a record’s whole neighborhood, across several hops. That lookup must also be time-correct, so no future data leaks into training.
图学习保留了结构。每一行变成一个节点,每个外键变成一条边。难点在于规模。一次预测需要一个记录的整个邻域,跨越多个跳数。这种查找还必须是时间正确的,以防止未来数据泄露到训练中。
How does DiskGraph work?
DiskGraph 是如何工作的?
Kumo Engine converts tables into a graph once, at ingest. The README lists 5 design choices:
Kumo Engine 在数据摄入时将表转换为图一次。README 列出了 5 个设计选择:
- Links resolved at ingest: Minimal perfect hashing maps each primary key to a compact integer ID. Following a link becomes a lookup, not a join.
- Bounded context: Each hop samples a capped number of related records.
- Newest-first storage: Links are stored per relationship, newest first. A binary search finds the prediction time.
- Ordered reads: Large batches are sorted by disk position, so reads move through files in order.
- Larger than memory: Graph files are read-only and memory-mapped. The OS caches hot pages and reads the rest on demand.
- 摄入时解析链接:最小完美哈希将每个主键映射为紧凑的整数 ID。跟随链接变为查找操作,而非连接操作。
- 有界上下文:每个跳数采样固定数量的相关记录。
- 最新优先存储:链接按关系存储,最新的在前。通过二分查找确定预测时间。
- 有序读取:大批量数据按磁盘位置排序,因此读取操作按顺序遍历文件。
- 大于内存:图文件只读且内存映射。操作系统缓存热点页面,其余按需读取。
How fast is Kumo Engine? Benchmarks
Kumo Engine 有多快?基准测试
All figures below are self-reported by NVIDIA on its benchmark page.
以下所有数据均由 NVIDIA 在其基准测试页面上自行报告。
Context generation. The test used a synthetic commerce graph with 50B nodes and 175.5B edges. It ran on an AWS i4i.32xlarge with 128 vCPUs, 1 TiB RAM and striped NVMe. Warm retrieval, in seconds per million seeds:
上下文生成。测试使用了包含 500 亿个节点和 1755 亿条边的合成商业图。运行在具有 128 个 vCPU、1 TiB RAM 和条带化 NVMe 的 AWS i4i.32xlarge 实例上。预热检索时间(每秒百万种子节点):
| Hops | Kumo Engine | Prepared DuckDB 2.0.0 | DuckDB on Parquet |
|---|---|---|---|
| 2 | 5.3 s | 46.9 s | 103.4 s |
| 3 | 19.9 s | 63.6 s | 148.4 s |
| 4 | 38.9 s | 94.9 s | 208.5 s |
| Hops | Kumo Engine | 预处理的 DuckDB 2.0.0 | Parquet 上的 DuckDB |
|---|---|---|---|
| 2 | 5.3 秒 | 46.9 秒 | 103.4 秒 |
| 3 | 19.9 秒 | 63.6 秒 | 148.4 秒 |
| 4 | 38.9 秒 | 94.9 秒 | 208.5 秒 |
The reference results in the repo match these numbers. An earlier run against DuckDB 1.5.6 showed a wider gap. Kumo took 5, 19 and 39 seconds. DuckDB took 4.0, 5.3 and 6.5 minutes. NVIDIA says DuckDB 2.0.0 was 2x to 8x faster than 1.5.6.
仓库中的参考结果与这些数字相符。早期针对 DuckDB 1.5.6 的运行显示出更大的差距。Kumo 耗时分别为 5、19 和 39 秒。DuckDB 耗时分别为 4.0、5.3 和 6.5 分钟。NVIDIA 表示,DuckDB 2.0.0 比 1.5.6 快 2 到 8 倍。
Training. On a 111M-node citation graph, Kumo Engine trained 15 epochs in 41 min 14 s. A matched in-memory PyG setup took 64 min 13 s. Both ran on 1 A10G GPU. Training memory was 17 to 37 GiB for Kumo versus about 166 GiB for PyG. Test accuracy was 63.26% versus 63.93%.
训练。在包含 1.11 亿个节点的引用图上,Kumo Engine 在 41 分 14 秒内完成了 15 个 epoch 的训练。配置相同的内存中 PyG 环境耗时 64 分 13 秒。两者均在 1 块 A10G GPU 上运行。Kumo 的训练内存占用为 17 至 37 GiB,而 PyG 约为 166 GiB。测试准确率分别为 63.26% 和 63.93%。
End to end. On the 50B dataset, raw Parquet to trained model took 5.2 hours. A hand-built DuckDB feature pipeline took 9.9 hours. NVIDIA notes the model families differ, so this is a workflow comparison.
端到端。在 500 亿数据集上,从原始 Parquet 文件到训练完成的模型耗时 5.2 小时。手动构建的 DuckDB 特征管道耗时 9.9 小时。NVIDIA 指出模型系列不同,因此这属于工作流对比。
How do you use Kumo Engine?
如何使用 Kumo Engine?
The workflow is Python. You define tables, keys and time columns, then link them into a graph. You write the target as a predictive query:
工作流基于 Python。你定义表、键和时间列,然后将它们链接成图。你将目标编写为预测查询:
PREDICT COUNT(orders.*, 0, 30, days) > 0 FOR EACH users.user_id
The engine then builds labeled training tables, samples context, trains a built-in temporal GNN and runs batch prediction. It handles classification, regression, forecasting and recommendation tasks.
引擎随后构建带标签的训练表,采样上下文,训练内置的时间图神经网络(temporal GNN)并运行批量预测。它支持分类、回归、预测和推荐任务。
The base package reads local CSV and Parquet. Optional extras add S3, GCS, Azure Data Lake, BigQuery, Snowflake and Databricks. It also integrates with MLflow and SageMaker. A bundled agent skill teaches coding agents the API. Install it with python -m kumo.engine.skills.
基础包读取本地 CSV 和 Parquet 文件。可选扩展功能支持 S3、GCS、Azure Data Lake、BigQuery、Snowflake 和 Databricks。它还集成 MLflow 和 SageMaker。捆绑的 agent skill 可教编码代理使用 API。使用 python -m kumo.engine.skills 安装。
Comparison: Kumo Engine vs PyG, GraphStorm and DuckDB
对比:Kumo Engine vs PyG、GraphStorm 和 DuckDB
| Feature | Kumo Engine | PyG | GraphStorm | DuckDB |
|---|---|---|---|---|
| Type | Disk-backed sampler + built-in temporal GNN | GNN library for PyTorch | Graph ML framework (AWS) | In-process SQL database |
| License | Apache 2.0 | MIT | Apache 2.0 | MIT |
| Graph storage in NVIDIA tests | Memory-mapped DiskGraph on NVMe | In RAM | In RAM | Native tables + sorted adjacency tables |
| 50B graph, 2-hop warm (s per 1M seeds) | 5.3 s | Not tested | Not tested | 46.9 s (prepared, 2.0.0) |
| 111M-node graph, 15 epochs | 41 min 14 s (1 A10G) | 64 min 13 s (1 A10G) | 14 min on 4 x g5.48xlarge; single node failed | Not applicable |
| Test accuracy (citation graph) | 63.26% | 63.93% | Not disclosed | Not applicable |
| Raw data to trained model, 50B | 5.2 h | Not tested | Not tested | 9.9 h (feature pipeline, 1.5.5) |
| 特性 | Kumo Engine | PyG | GraphStorm | DuckDB |
|---|---|---|---|---|
| 类型 | 磁盘支持的采样器 + 内置时间图神经网络 | PyTorch 的 GNN 库 | 图机器学习框架 (AWS) | 进程内 SQL 数据库 |
| 许可证 | Apache 2.0 | MIT | Apache 2.0 | MIT |
| NVIDIA 测试中的图存储 | NVMe 上的内存映射 DiskGraph | 内存中 | 内存中 | 原生表 + 排序后的邻接表 |
| 500 亿边图,2-hop 预热(每 100 万种子耗时/秒) | 5.3 秒 | 未测试 | 未测试 | 46.9 秒(预处理,2.0.0) |
| 1.11 亿节点图,15 个 epoch | 41 分 14 秒(1 块 A10G) | 64 分 13 秒(1 块 A10G) | 4 x g5.48xlarge 上耗时 14 分钟;单节点失败 | 不适用 |
| 测试准确率(引用图) | 63.26% | 63.93% | 未披露 | 不适用 |
| 原始数据到训练完成的模型,500 亿边 | 5.2 小时 | 未测试 | 未测试 | 9.9 小时(特征管道,1.5.5) |
Key Takeaways
关键要点
- Kumo Engine turns linked tables into an on-disk graph for GNN training.
- Rust DiskGraph samples time-correct neighborhoods straight from NVMe.
- 2-hop retrieval: 5.3 s vs 46.9 s for prepared DuckDB.
- Cuts training time 36% vs PyG, at 0.67 points lower accuracy.
- Apache 2.0, pip install kumo-engine, with agent skills included.
- Kumo Engine 将链接的表转换为用于 GNN 训练的磁盘图。
- Rust DiskGraph 直接从 NVMe 采样时间校正的邻域。
- 2跳检索:5.3秒,而预处理的DuckDB为46.9秒。
- 相比PyG,训练时间减少36%,但准确率降低0.67个百分点。
- Apache 2.0协议,通过pip install kumo-engine安装,包含智能体技能。
Check out the GitHub repo, documentation and benchmarks. You can check the deployment options and specs here through our GPULeaderboard.com chrome extension.
查看GitHub仓库、文档和基准测试。您可以通过我们的GPULeaderboard.com Chrome扩展程序在此处查看部署选项和规格。
Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
此外,欢迎在Twitter上关注我们,别忘了加入我们拥有15万+成员的ML SubReddit,并订阅我们的新闻通讯。等等!你在Telegram上吗?现在你也可以加入我们的Telegram群组。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力