In the TabPFN-3.5 and Clef article, I used a small table to explain how a model can learn from the examples you put in front of it. Here I wanted to run the whole thing: give C-Kernel-Engine a table with some known labels and some missing labels, and see what comes out. This port uses TabPFN v1, the original classifier. The earlier article’s newer 3.5 architecture is a different model.

Run TabPFN v1 with CKE

Start in an empty working directory on Linux. You need Git, a C compiler (cc), and Python 3.12 with venv. The example uses 12 labeled Iris rows and three unlabeled queries. You don’t need a GPU, OpenBLAS, ONNX Runtime, or a Python process at inference time.

1. Build the portable bundle

Clone CKE, fetch the pinned publisher checkpoint, and compile the classifier for this row split. Stay in the CKE directory for the next two steps.

Build the portable TabPFN bundleBash
git clone --filter=blob:none https://github.com/C-Kernel-Engine/C-Kernel-Engine.git
cd C-Kernel-Engine
git checkout --detach 27a980b8e
git clone --depth 1 --branch tabpfn_v1 https://github.com/PriorLabs/TabPFN.git upstream-tabpfn
test "$(git -C upstream-tabpfn rev-parse HEAD)" = bef0cf257f3c4c519a2f8e301e0b81a26ae73aff
python3 -m venv .venv
source .venv/bin/activate
python -m pip install numpy jsonschema
python -m pip install 'torch==2.10.0' --index-url https://download.pytorch.org/whl/cpu
checkpoint=upstream-tabpfn/tabpfn/models_diff/prior_diff_real_checkpoint_n_0_epoch_42.cpkt
python version/v8/tabular/tabpfn_v1.py "$checkpoint" bundle --train 12 --queries 3

The build creates bundle/classify, bundle/generated.so, and bundle/weights.arena. Keep all three together. Python isn’t needed after this step.

2. Create the sample input

Copy this block to create iris.txt. The header is feature count, class count. The next 12 lines start with a class ID, then four measurements in centimetres: sepal length, sepal width, petal length and petal width. The last three lines contain only measurements. Class IDs are 0 = setosa, 1 = versicolor, 2 = virginica. The CLI reads whitespace-delimited values, not CSV.

Create iris.txt from replay seed 15Bash
cat > iris.txt <<'TABLE'
4 3
0 5.0999999 3.5 1.39999998 0.200000003
1 6.0999999 2.79999995 4 1.29999995
2 7.4000001 2.79999995 6.0999999 1.89999998
0 5.69999981 3.79999995 1.70000005 0.300000012
1 5.5999999 2.5 3.9000001 1.10000002
2 6.19999981 2.79999995 4.80000019 1.79999995
0 5 3.5 1.60000002 0.600000024
1 6.19999981 2.9000001 4.30000019 1.29999995
2 6.30000019 2.9000001 5.5999999 1.79999995
0 4.4000001 3.20000005 1.29999995 0.200000003
1 5.69999981 3 4.19999981 1.20000005
2 4.9000001 2.5 4.5 1.70000005
7.9000001 3.79999995 6.4000001 2
6.4000001 2.70000005 5.30000019 1.89999998
6.5 3.20000005 5.0999999 2
TABLE

3. Run the native classifier and read the result

Run the C classifierBash
./bundle/classify bundle/weights.arena iris.txt
Expected probabilities, rounded to four decimalsText
0.0999  0.4702  0.4299
0.0004  0.0041  0.9954
0.0390  0.4311  0.5298

You should get three rows, with winning class IDs 1, 2, 2. Each row follows the input query order; its columns are ordered setosa, versicolor, virginica. The host keeps the first K logits for the declared class count and applies softmax with temperature 0.8. These are normalized model scores, not guarantees of calibrated confidence. Add --logits before the arena path to inspect all ten raw scores instead.

The three Iris queries in input order
QueryActualPredictedWinning scoreResult
1virginicaversicolor47.0%Incorrect
2virginicavirginica99.5%Correct
3virginicavirginica53.0%Correct

There are two questions in the results below. Did CKE give the same answer as the original PyTorch implementation? And was that answer right? The first is a test of the runtime. The second is a test of the model on these particular held-out rows.

The whole model, from rows to scores

Explore the 12-layer TabPFN v1 architecture
Explore the 12-layer TabPFN v1 architecture

The original TabPFN paper describes a model pretrained to infer labels from synthetic tasks drawn from a prior over plausible data-generating processes. At inference time, the labeled examples are added to the input. The checkpoint stays fixed. If I replace the labeled rows, the model can make different predictions without a training job, optimizer, or weight update.

Let T be the number of labeled rows and Q the number of unlabeled query rows. The host prepares an input matrix of size (T + Q) × 100. A learned projection moves each row to width 512. A separate label encoder adds information only to the labeled prefix: [class_id, 1] produces Wᵧ · class_id + bᵧ; [0, 0] for a query produces zero. That second input is what distinguishes a known class zero from an unknown label.

All 12 encoder blocks have their own weights. In each block, the attention and feed-forward branches both use residual adds followed by LayerNorm. The feed-forward branch goes from 512 to 1,024 channels, applies exact erf GELU, then projects back to 512. The final MLP goes from 512 to 1,024 to ten logits. It’s called a decoder in the checkpoint, but it is a classification head: no next-token generation, tokenizer, or KV cache.

One block: where does a query get its information?

Open the attention, residual and FFN operations
Open the attention, residual and FFN operations

Each head builds attention queries for every row, but builds keys and values only for the T labeled rows. Each of the four heads has width 128. A query can read the labeled context, but can’t read the other queries, and the labeled rows can’t read it. This is why scoring an unlabeled row alongside more unlabeled rows doesn’t give it new evidence.

A=softmax(QK⊤128)V

Here Q in the equation is the projected query tensor, not the row count. For a 12+3 input, the score matrix is 15 × 12 per head. CKE represents that rectangle directly. It doesn’t construct a 15 × 15 score matrix and then zero out access to the three query columns. In the C source the attention call receives query_tokens=15 and memory_tokens=12.

Prepare your own table

Pick a feature schema first and keep its ordering and units the same for context and query rows. Encode labels as contiguous integers starting at zero, and include at least one labeled example of each declared class. Keep the query labels in a separate file if you want to score the predictions later. The bundle fixes T and Q at build time; you can reuse it for other valid tables with the same row split.

The host accepts 1–100 finite numeric features, 2–10 classes, and at most 1,000 total rows. It removes columns that are constant in the labeled context, derives the mean and sample standard deviation from that context, applies the reference’s outlier shaping, then rescales and pads to width 100. It rejects an all-constant feature table. Missing values, raw categories, regression, and the publisher’s default multi-member ensemble are outside this port’s tested scope. If your data needs imputation or encoding, fit that step without using the held-out labels or statistics from the query split.

Negative inputs checked against the native parser
InputExitPrediction rows
NaN in a feature1None
One query row missing1None
Unexpected label in query1None
Declared class missing from context1None

48 tables: actual predictions, including the misses

I replayed six datasets with four seeds and two row splits: 12 labeled rows plus three queries, and 64 plus 16. Iris, Wine, Wisconsin Diagnostic Breast Cancer and Digits came from the bundled scikit-learn datasets; clusters and XOR are generated fixtures. Each split keeps its labeled and query sets disjoint. These are 456 query predictions, not necessarily 456 unique records across seeds. The breast-cancer table is a software test fixture, not clinical evidence.

Held-out accuracy by dataset. 411 of 456 correct overall.
411/456 correct (90.1%); 456/456 agree with the publisher. Maximum absolute error: 7e-05 in logits and 6.7e-06 in probabilities.
Held-out labels by dataset and row split
DatasetFeaturesClasses12+364+16Overall
Iris439/1263/6494.7%
Wine13311/1261/6494.7%
Wisconsin breast cancer30212/1262/6497.4%
Digits64105/1249/6471.1%
Synthetic clusters3312/1264/64100.0%
Synthetic XOR428/1255/6482.9%

The first Iris query had label virginica. Both runtimes picked versicolor at 47.0%, with virginica at 43.0%. The runtime reproduced the model accurately, including this mistake. With a small context, the choice of labeled examples is part of what you are testing.

Open any group to see each predicted class, held-out label and winning score. The scores in the table come from native CKE. The reference runs the same v1 checkpoint with one ensemble member, no power transform and no class or feature rotation.

Iris: 12+3, 9/12 correct
Iris: 12+3, 9/12 correct; 12/12 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 121147.0%Incorrect
15 / 222299.5%Correct
15 / 322253.0%Correct
32 / 121156.3%Incorrect
32 / 200089.4%Correct
32 / 321171.4%Incorrect
67 / 100097.4%Correct
67 / 200096.4%Correct
67 / 322299.7%Correct
81 / 100098.6%Correct
81 / 211197.9%Correct
81 / 311196.0%Correct
Iris: 64+16, 63/64 correct
Iris: 64+16, 63/64 correct; 64/64 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 1111100.0%Correct
15 / 222299.9%Correct
15 / 3000100.0%Correct
15 / 411199.8%Correct
15 / 522299.7%Correct
15 / 622299.9%Correct
15 / 722299.9%Correct
15 / 8222100.0%Correct
15 / 9000100.0%Correct
15 / 1011194.6%Correct
15 / 1112257.9%Incorrect
15 / 1222299.9%Correct
15 / 13000100.0%Correct
15 / 1411197.3%Correct
15 / 15111100.0%Correct
15 / 1622297.5%Correct
32 / 100099.7%Correct
32 / 2222100.0%Correct
32 / 3000100.0%Correct
32 / 4000100.0%Correct
32 / 522298.7%Correct
32 / 6222100.0%Correct
32 / 722299.9%Correct
32 / 811198.8%Correct
32 / 922299.0%Correct
32 / 10222100.0%Correct
32 / 11111100.0%Correct
32 / 1222299.3%Correct
32 / 1322299.1%Correct
32 / 14000100.0%Correct
32 / 15222100.0%Correct
32 / 1622295.0%Correct
67 / 1222100.0%Correct
67 / 222299.9%Correct
67 / 3111100.0%Correct
67 / 422298.8%Correct
67 / 511199.9%Correct
67 / 600099.5%Correct
67 / 700099.8%Correct
67 / 822299.9%Correct
67 / 900099.9%Correct
67 / 10222100.0%Correct
67 / 11000100.0%Correct
67 / 1211199.6%Correct
67 / 1300093.0%Correct
67 / 1400099.6%Correct
67 / 15222100.0%Correct
67 / 1622296.1%Correct
81 / 100099.9%Correct
81 / 200098.5%Correct
81 / 3000100.0%Correct
81 / 4000100.0%Correct
81 / 511193.0%Correct
81 / 6000100.0%Correct
81 / 7000100.0%Correct
81 / 8111100.0%Correct
81 / 911199.6%Correct
81 / 10222100.0%Correct
81 / 11222100.0%Correct
81 / 12111100.0%Correct
81 / 13111100.0%Correct
81 / 14222100.0%Correct
81 / 1511198.3%Correct
81 / 1622299.7%Correct
Wine: 12+3, 11/12 correct
Wine: 12+3, 11/12 correct; 12/12 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 111175.2%Correct
15 / 200090.2%Correct
15 / 311147.8%Correct
32 / 111183.6%Correct
32 / 211179.9%Correct
32 / 311178.9%Correct
67 / 122293.1%Correct
67 / 211182.0%Correct
67 / 300074.1%Correct
81 / 110054.9%Incorrect
81 / 200095.2%Correct
81 / 322291.4%Correct
Wine: 64+16, 61/64 correct
Wine: 64+16, 61/64 correct; 64/64 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 122299.6%Correct
15 / 211199.6%Correct
15 / 311198.8%Correct
15 / 400099.7%Correct
15 / 522298.8%Correct
15 / 622298.1%Correct
15 / 722296.8%Correct
15 / 811197.7%Correct
15 / 922299.7%Correct
15 / 1011179.0%Correct
15 / 1100091.7%Correct
15 / 1200099.3%Correct
15 / 1322299.7%Correct
15 / 1400099.8%Correct
15 / 1511199.1%Correct
15 / 1622299.7%Correct
32 / 111161.7%Correct
32 / 200077.1%Correct
32 / 311199.8%Correct
32 / 411196.4%Correct
32 / 5111100.0%Correct
32 / 600094.2%Correct
32 / 711198.8%Correct
32 / 800099.9%Correct
32 / 900099.9%Correct
32 / 1011199.9%Correct
32 / 11222100.0%Correct
32 / 1211159.9%Correct
32 / 1311189.7%Correct
32 / 1400098.4%Correct
32 / 1500094.0%Correct
32 / 1600095.8%Correct
67 / 1000100.0%Correct
67 / 211198.9%Correct
67 / 3000100.0%Correct
67 / 4000100.0%Correct
67 / 512279.3%Incorrect
67 / 6111100.0%Correct
67 / 722299.9%Correct
67 / 811164.0%Correct
67 / 9000100.0%Correct
67 / 1011195.1%Correct
67 / 1100099.6%Correct
67 / 1211163.3%Correct
67 / 1322298.3%Correct
67 / 1422299.6%Correct
67 / 1511181.1%Correct
67 / 1622299.2%Correct
81 / 111186.5%Correct
81 / 200099.9%Correct
81 / 300099.2%Correct
81 / 422299.9%Correct
81 / 511175.7%Correct
81 / 610062.8%Incorrect
81 / 722298.9%Correct
81 / 812261.4%Incorrect
81 / 9000100.0%Correct
81 / 1022299.9%Correct
81 / 11000100.0%Correct
81 / 1211199.9%Correct
81 / 1300093.7%Correct
81 / 1400099.6%Correct
81 / 1511187.1%Correct
81 / 1611195.3%Correct
Wisconsin breast cancer: 12+3, 12/12 correct
Wisconsin breast cancer: 12+3, 12/12 correct; 12/12 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 100095.2%Correct
15 / 200079.5%Correct
15 / 311165.6%Correct
32 / 100069.2%Correct
32 / 200095.4%Correct
32 / 300096.0%Correct
67 / 111198.3%Correct
67 / 211194.4%Correct
67 / 311198.5%Correct
81 / 100096.9%Correct
81 / 211191.3%Correct
81 / 300097.5%Correct
Wisconsin breast cancer: 64+16, 62/64 correct
Wisconsin breast cancer: 64+16, 62/64 correct; 64/64 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 111199.3%Correct
15 / 211179.8%Correct
15 / 311197.9%Correct
15 / 411199.9%Correct
15 / 511198.6%Correct
15 / 611195.9%Correct
15 / 700099.7%Correct
15 / 800099.6%Correct
15 / 911199.4%Correct
15 / 10111100.0%Correct
15 / 1100097.6%Correct
15 / 1211199.4%Correct
15 / 13111100.0%Correct
15 / 1400097.2%Correct
15 / 1500099.9%Correct
15 / 1611164.8%Correct
32 / 111199.9%Correct
32 / 211199.5%Correct
32 / 311178.7%Correct
32 / 400099.9%Correct
32 / 5000100.0%Correct
32 / 611184.0%Correct
32 / 700098.6%Correct
32 / 800099.0%Correct
32 / 900099.6%Correct
32 / 10111100.0%Correct
32 / 1111199.8%Correct
32 / 1211199.6%Correct
32 / 1311193.4%Correct
32 / 1411191.6%Correct
32 / 1511197.7%Correct
32 / 1600099.2%Correct
67 / 100099.5%Correct
67 / 2111100.0%Correct
67 / 300099.1%Correct
67 / 4000100.0%Correct
67 / 5111100.0%Correct
67 / 6111100.0%Correct
67 / 7111100.0%Correct
67 / 8000100.0%Correct
67 / 900095.5%Correct
67 / 1000099.9%Correct
67 / 1111199.9%Correct
67 / 1211193.0%Correct
67 / 1300099.7%Correct
67 / 14000100.0%Correct
67 / 15000100.0%Correct
67 / 1601154.9%Incorrect
81 / 111198.8%Correct
81 / 2111100.0%Correct
81 / 310071.3%Incorrect
81 / 4111100.0%Correct
81 / 500099.4%Correct
81 / 6111100.0%Correct
81 / 7111100.0%Correct
81 / 811195.9%Correct
81 / 9111100.0%Correct
81 / 1011199.8%Correct
81 / 11000100.0%Correct
81 / 12000100.0%Correct
81 / 1311199.9%Correct
81 / 14000100.0%Correct
81 / 15111100.0%Correct
81 / 16111100.0%Correct
Digits: 12+3, 5/12 correct
Digits: 12+3, 5/12 correct; 12/12 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 190014.4%Incorrect
15 / 270013.4%Incorrect
15 / 341115.3%Incorrect
32 / 100021.8%Correct
32 / 260014.2%Incorrect
32 / 371115.6%Incorrect
67 / 100020.7%Correct
67 / 200020.2%Correct
67 / 371114.7%Incorrect
81 / 151115.6%Incorrect
81 / 266616.5%Correct
81 / 311115.8%Correct
Digits: 64+16, 49/64 correct
Digits: 64+16, 49/64 correct; 64/64 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 166682.8%Correct
15 / 244487.8%Correct
15 / 311135.2%Correct
15 / 499958.7%Correct
15 / 522259.3%Correct
15 / 615531.5%Incorrect
15 / 797741.2%Incorrect
15 / 877785.2%Correct
15 / 983332.2%Incorrect
15 / 1011126.1%Correct
15 / 1188821.2%Correct
15 / 1200079.2%Correct
15 / 1366659.9%Correct
15 / 1487732.4%Incorrect
15 / 1566651.1%Correct
15 / 1611135.5%Correct
32 / 166649.5%Correct
32 / 277744.2%Correct
32 / 397717.8%Incorrect
32 / 400063.1%Correct
32 / 555535.9%Correct
32 / 644488.9%Correct
32 / 777748.0%Correct
32 / 822246.0%Correct
32 / 966624.4%Correct
32 / 1033337.9%Correct
32 / 1128826.0%Incorrect
32 / 1211122.6%Correct
32 / 1300089.7%Correct
32 / 1466664.6%Correct
32 / 1523327.9%Incorrect
32 / 1644460.6%Correct
67 / 188824.2%Correct
67 / 298833.7%Incorrect
67 / 377735.8%Correct
67 / 400064.0%Correct
67 / 593353.0%Incorrect
67 / 624425.1%Incorrect
67 / 793329.3%Incorrect
67 / 822254.9%Correct
67 / 900023.2%Correct
67 / 1055535.6%Correct
67 / 1166689.1%Correct
67 / 1217729.8%Incorrect
67 / 1317729.0%Incorrect
67 / 1411143.0%Correct
67 / 1566686.9%Correct
67 / 1688830.1%Correct
81 / 133339.3%Correct
81 / 212258.9%Incorrect
81 / 311134.5%Correct
81 / 477745.8%Correct
81 / 500094.2%Correct
81 / 621135.5%Incorrect
81 / 733339.2%Correct
81 / 844449.2%Correct
81 / 911126.9%Correct
81 / 1022231.4%Correct
81 / 1177724.4%Correct
81 / 1244474.7%Correct
81 / 1311135.8%Correct
81 / 1400099.2%Correct
81 / 1544446.4%Correct
81 / 1633342.1%Correct
Synthetic clusters: 12+3, 12/12 correct
Synthetic clusters: 12+3, 12/12 correct; 12/12 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 100074.2%Correct
15 / 211198.8%Correct
15 / 311193.0%Correct
32 / 122299.0%Correct
32 / 211195.9%Correct
32 / 311179.9%Correct
67 / 100099.5%Correct
67 / 222299.7%Correct
67 / 300093.4%Correct
81 / 100098.2%Correct
81 / 222283.7%Correct
81 / 311164.8%Correct
Synthetic clusters: 64+16, 64/64 correct
Synthetic clusters: 64+16, 64/64 correct; 64/64 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 1222100.0%Correct
15 / 211199.8%Correct
15 / 3111100.0%Correct
15 / 400097.4%Correct
15 / 5000100.0%Correct
15 / 622299.8%Correct
15 / 7111100.0%Correct
15 / 8111100.0%Correct
15 / 9000100.0%Correct
15 / 1000099.9%Correct
15 / 11000100.0%Correct
15 / 12000100.0%Correct
15 / 13222100.0%Correct
15 / 14111100.0%Correct
15 / 15111100.0%Correct
15 / 16222100.0%Correct
32 / 122299.9%Correct
32 / 2222100.0%Correct
32 / 322299.9%Correct
32 / 411199.6%Correct
32 / 5111100.0%Correct
32 / 6222100.0%Correct
32 / 722299.9%Correct
32 / 8000100.0%Correct
32 / 922299.6%Correct
32 / 1011199.8%Correct
32 / 1111199.8%Correct
32 / 12000100.0%Correct
32 / 13111100.0%Correct
32 / 14111100.0%Correct
32 / 1522275.7%Correct
32 / 1611199.8%Correct
67 / 1111100.0%Correct
67 / 200099.9%Correct
67 / 3000100.0%Correct
67 / 4222100.0%Correct
67 / 5222100.0%Correct
67 / 6000100.0%Correct
67 / 7222100.0%Correct
67 / 8000100.0%Correct
67 / 9000100.0%Correct
67 / 1000096.2%Correct
67 / 11111100.0%Correct
67 / 12000100.0%Correct
67 / 13000100.0%Correct
67 / 14000100.0%Correct
67 / 15111100.0%Correct
67 / 16222100.0%Correct
81 / 1222100.0%Correct
81 / 2222100.0%Correct
81 / 3111100.0%Correct
81 / 422299.9%Correct
81 / 5111100.0%Correct
81 / 6222100.0%Correct
81 / 7222100.0%Correct
81 / 8222100.0%Correct
81 / 900099.8%Correct
81 / 1011199.9%Correct
81 / 11111100.0%Correct
81 / 12000100.0%Correct
81 / 1322299.7%Correct
81 / 14111100.0%Correct
81 / 1522298.6%Correct
81 / 16222100.0%Correct
Synthetic XOR: 12+3, 8/12 correct
Synthetic XOR: 12+3, 8/12 correct; 12/12 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 111162.1%Correct
15 / 211176.4%Correct
15 / 311175.1%Correct
32 / 100050.9%Correct
32 / 210062.1%Incorrect
32 / 311154.9%Correct
67 / 110052.0%Incorrect
67 / 200062.2%Correct
67 / 311155.0%Correct
81 / 101187.7%Incorrect
81 / 211190.6%Correct
81 / 301187.8%Incorrect
Synthetic XOR: 64+16, 55/64 correct
Synthetic XOR: 64+16, 55/64 correct; 64/64 match the reference
Seed / rowTrueCKEReferenceWinning scoreResult
15 / 111199.8%Correct
15 / 200082.2%Correct
15 / 311199.4%Correct
15 / 411198.4%Correct
15 / 511196.1%Correct
15 / 600098.5%Correct
15 / 700089.4%Correct
15 / 811196.8%Correct
15 / 910068.9%Incorrect
15 / 1011189.8%Correct
15 / 1101171.7%Incorrect
15 / 1200089.1%Correct
15 / 1310064.4%Incorrect
15 / 1400095.2%Correct
15 / 1500093.3%Correct
15 / 1611189.0%Correct
32 / 100097.9%Correct
32 / 200096.7%Correct
32 / 301171.8%Incorrect
32 / 400086.8%Correct
32 / 511196.7%Correct
32 / 611198.9%Correct
32 / 701154.0%Incorrect
32 / 811196.1%Correct
32 / 911198.6%Correct
32 / 1011180.5%Correct
32 / 1111199.3%Correct
32 / 1200093.3%Correct
32 / 1311198.7%Correct
32 / 1411198.5%Correct
32 / 1500099.7%Correct
32 / 1610086.9%Incorrect
67 / 100082.6%Correct
67 / 210081.7%Incorrect
67 / 300054.5%Correct
67 / 400093.5%Correct
67 / 500095.1%Correct
67 / 601163.4%Incorrect
67 / 700095.2%Correct
67 / 811195.9%Correct
67 / 900098.5%Correct
67 / 1000099.2%Correct
67 / 1100098.6%Correct
67 / 1200098.0%Correct
67 / 1300082.1%Correct
67 / 1411199.1%Correct
67 / 1511176.1%Correct
67 / 1611199.3%Correct
81 / 100088.8%Correct
81 / 211199.5%Correct
81 / 300089.7%Correct
81 / 400090.3%Correct
81 / 511151.6%Correct
81 / 600081.6%Correct
81 / 700091.7%Correct
81 / 811168.9%Correct
81 / 900064.9%Correct
81 / 1011195.8%Correct
81 / 1111169.5%Correct
81 / 1211186.6%Correct
81 / 1300066.7%Correct
81 / 1400092.6%Correct
81 / 1500090.9%Correct
81 / 1610062.4%Incorrect

What CKE actually added

Follow the build and native inference paths
Follow the build and native inference paths

The bring-up PR, #1393, adds the checked v8 circuit, native table frontend, released-weight parity tests and benchmark. The importer checks the checkpoint hash, splits the publisher’s packed Q/K/V tensors into CKE’s three projections, and rewrites the label projection to carry the training flag. None of that retrains the model.

The circuit records named tensor views, shapes and weight references. CKE lowers those to a plan of 150 kernel calls and offsets in one arena; then it emits a C entry point, ck_tabpfn_v1(arena, arena_bytes). The classify executable is the small host around it: parse rows, produce the two input buffers, call the generated code and write the probabilities. Inspect circuit.json for the graph, call.json for the selected kernels and their arguments, layout.json for offsets, and generated.c for the actual calls.

The new provider maps include SGEMM projection and rectangular attention, vector erf GELU, and packed FP32 projections. Packed weights put groups of output channels into panels once at build time. The threaded preset can distribute output channels or independent rows across workers. These are alternative implementations of the same operations. The portable build has no BLAS requirement; the OpenBLAS run below uses --sgemm for eligible projections. The separate fast and packed presets use a compatible LP64 BLAS and vsErf for remaining work in the documented oneMKL setup.

CKE implementation trail

Three changes in PR #1393

Native classifier, then CPU optimization
  1. 92d6fa785
    Run the whole classifier in generated C
    Import the released weights, lower all 12 layers and exercise the native host with raw tables and publisher parity checks.
  2. 745de24cb
    Speed up attention and GELU
    Add optional FP32 rectangular attention and vector erf providers so these calls can use optimized CPU math.
  3. 9297a0cda
    Pack weights once and split the remaining work
    Store FP32 projection weights in panels at build time and parallelize checked row operations for the optimized preset.

What the runtime costs

I ran both paths on the same Intel Core i7-1260P laptop, pinned to one logical CPU with one thread. Each number summarizes 24 requests of that shape after a warm-up. CKE includes text parsing, preprocessing, forward pass and writing probabilities; PyTorch starts from in-memory arrays and includes tensor construction, preprocessing, inference and copying results for comparison. Weight loading and dataset construction are excluded. These are practical timings with different input boundaries, not a clean kernel speed ratio.

Laptop replay timings
Labeled + queryRuntimeRequestsMedianp95
12+3CKE portable24230.68 ms251.91 ms
12+3CKE + OpenBLAS2457.87 ms63.62 ms
12+3Publisher PyTorch2450.22 ms51.59 ms
64+16CKE + OpenBLAS24217.12 ms227.33 ms
64+16Publisher PyTorch24122.73 ms126.61 ms

The native bundle is small if you count the program and generated library; the artifact carrying the weights and activation arena is much bigger. The 12+3 OpenBLAS bundle had a 16.7 KiB executable, a 51.7 KiB library and a 104.2 MiB arena. Ship the executable, shared library and arena together for the target architecture. The Python build step doesn’t have to run on the deployment device.

Separate P3 and Ryzen measurements

The CKE model bring-up guide reports a matched four-core test of the 64+16 shape across packed CKE, publisher PyTorch, and ONNX Runtime. It measured warm prepared-input prediction, excluding text parsing and weight loading. These are the project’s published measurements, not results rerun on this laptop.

CKE project reference: 64+16, four physical cores, median
MachinePacked CKEEarlier CKE FP32Publisher PyTorchONNX Runtime
P316.55 ms21.33 ms18.79 ms13.02 ms
Ryzen6.35 ms19.04 ms16.31 ms6.47 ms

On that setup ONNX Runtime leads on P3, and packed CKE and ONNX Runtime are close on Ryzen. The packed run is not the portable quickstart. For numerical parity, compare the same checkpoint, precision, inputs, and recipe before drawing any conclusion from the timings.

Where I’d use this

I’d start with a small classification workflow where I already have numeric features and enough trustworthy labeled examples to define the decision. I’d keep a separate test set, compare with a simple baseline, and look closely at the wrong rows and their scores before deciding whether TabPFN helps. The runtime work makes it possible to package and inspect this model in the same way as CKE’s text, vision and audio paths. It doesn’t settle which classifier is best for a new table.