Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Shopify Engineering 10 min read Deep dive hardMaster

TreeWalker: Avoiding redundant work across rows and trees

TreeWalker is an open-source Rust inference engine for gradient-boosted tree ensembles that evaluates groups of related rows together, resolving decisions on features that are constant across the group once and reusing prepared predicate masks for tests repeated across trees. It uses per-row bitmasks, sorted threshold sweeps and a cache-friendly node layout. An "unsplit" shortcut keeps a subset together when every active row takes the same branch. On Shopify's discrete-time hazard delivery-date model it scored 3.96× faster than the existing evaluator with identical results. Public benchmarks show 7.7–9.1× speedups at 104–128-row groups, but setup costs make it lose on many small-group configurations, and compiled engines like TL2cgen still win some cases.

Assumes: gradient boosted decision treesLightGBM or XGBoost inferenceCPU cache and branching basics

Related posts

  • Building world-class product search at Shopify: Where C++ excellence meets ML innovation

    Shopify Engineering easyNovice

    Shopify's product search runs ML ranking models (transformers, neural rankers, CatBoost/LightGBM) at native C++ speed through RankFlow, a Python-like ranking DSL, and TurboDSL, its execution engine. Data scientists write and deploy ranking modules in minutes without C++ expertise, while the runtime provides type safety, compile-time validation, vectorized execution and predictable latency. The team first shipped a simple engine (SimScorerDSL) that compiles DSL to C++ in about four weeks, then built TurboDSL behind the same syntax for a 48% speedup in ranking feature computation. Every PR gets an automated per-component latency analysis with significance testing at ±2% tolerance.

  • Introducing Velox: An open source unified execution engine

    Meta Engineering hardMaster

    Velox is Meta's open source C++ execution engine that unifies the data-plane components (expression evaluation, aggregation, joins, sorting, I/O, resource management) shared by engines like Presto, Spark and PyTorch's TorchArrow. It takes an optimized plan as input and runs it on a single host. It uses an Arrow-compatible columnar vector layout with multiple encodings, vectorized expression evaluation with dictionary peeling and common subexpression elimination, and runtime optimizations such as dynamic filter pushdown and adaptive prefetching. Replacing Presto Java workers with the Velox-based Prestissimo gave up to an order of magnitude speedup on CPU-bound TPC-H queries and 6-7x average speedups on production interactive workloads. Spark integrates Velox through Intel's Gluten via JNI using Arrow and Substrait.

  • What the interns have wrought, 2025 edition

    Jane Street Tech Blog hardMaster

    Jane Street's 2025 intern projects include an index-aware evaluator for JSQL, the company's internal SQL dialect, which over-approximates key ranges from WHERE clauses and specializes execution to Map, Hashtbl or multi-index containers, giving ~700x and ~30x speedups on 3.8M-row benchmarks. A redesigned ocamltorch API uses OxCaml's local mode and refcount scopes to free GPU tensors deterministically instead of forcing Gc.full_major calls. A third project is a shared-memory library that passes pointers between trading processes instead of serializing data, using atomic refcounts and OxCaml visibility modes (read_write, read, local) to enforce race-free, borrow-checker-like access.

  • Introducing TabFM: A zero-shot foundation model for tabular data

    Google Research easyNovice

    TabFM is a foundation model that treats tabular classification and regression as in-context learning, so it predicts on an unseen table in a single forward pass with no training, hyperparameter tuning or feature engineering. Its hybrid architecture combines TabPFN-style alternating row and column attention, compression of each row into a dense vector, and a TabICL-style Transformer over the compressed rows to keep compute low on larger tables. It is pretrained entirely on hundreds of millions of synthetic datasets generated from structural causal models. On TabArena (38 classification and 13 regression datasets, 700 to 150K rows), it is reported to beat tuned tree-based baselines in Elo, and an ensemble variant adds cross and SVD features, NNLS weighting and Platt scaling. It is available on Hugging Face and GitHub and through BigQuery's AI.PREDICT.

  • Scaling Model Evaluation at Pinterest with Ray (Part 4)

    Pinterest Engineering mediumAdept

    Pinterest fused model-evaluation metric computation into its Ray batch inference jobs, removing the separate Spark/Ray metrics job and the write-predictions-to-S3-then-reread handoff. The fusion relies on a metric contract (preprocess, compute partials per batch, reduce partials) that covers decomposable metrics like MAE, holistic metrics like ROC-AUC (approximated via per-threshold confusion matrices), and group-wise metrics like Precision@K. Group-wise metrics use Spark to pack complete segments into buckets so no segment spans a bucket. Overlapping CPU metric work with GPU inference via Ray's shared object store cut end-to-end evaluation time by 25–32% at 100 feature-importance experiments, with runtime scaling linearly in experiment count.

The quest for software engineering knowledge.

Look:
Layout: