FirePFN 0.0.1a0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- firepfn-0.0.1a0/AUTHORS +14 -0
- firepfn-0.0.1a0/FirePFN.egg-info/PKG-INFO +277 -0
- firepfn-0.0.1a0/FirePFN.egg-info/SOURCES.txt +51 -0
- firepfn-0.0.1a0/FirePFN.egg-info/dependency_links.txt +1 -0
- firepfn-0.0.1a0/FirePFN.egg-info/requires.txt +20 -0
- firepfn-0.0.1a0/FirePFN.egg-info/top_level.txt +1 -0
- firepfn-0.0.1a0/LICENSE +33 -0
- firepfn-0.0.1a0/LICENSES/Apache-2.0.txt +176 -0
- firepfn-0.0.1a0/LICENSES/BSD-3-Clause-TabICL.txt +236 -0
- firepfn-0.0.1a0/LICENSES/MIT-Hydra.txt +21 -0
- firepfn-0.0.1a0/LICENSES/OpenMDW-1.1-Kumo-Tabular-weights.txt +52 -0
- firepfn-0.0.1a0/NOTICE +39 -0
- firepfn-0.0.1a0/PKG-INFO +277 -0
- firepfn-0.0.1a0/README.md +243 -0
- firepfn-0.0.1a0/firepfn/__init__.py +7 -0
- firepfn-0.0.1a0/firepfn/class_tree.py +77 -0
- firepfn-0.0.1a0/firepfn/classifier.py +301 -0
- firepfn-0.0.1a0/firepfn/encoding.py +347 -0
- firepfn-0.0.1a0/firepfn/ensemble.py +44 -0
- firepfn-0.0.1a0/firepfn/eval/__init__.py +14 -0
- firepfn-0.0.1a0/firepfn/eval/analysis.py +294 -0
- firepfn-0.0.1a0/firepfn/eval/plots.py +330 -0
- firepfn-0.0.1a0/firepfn/eval/runtime.py +212 -0
- firepfn-0.0.1a0/firepfn/eval/tabarena.py +388 -0
- firepfn-0.0.1a0/firepfn/loading.py +97 -0
- firepfn-0.0.1a0/firepfn/many_class.py +157 -0
- firepfn-0.0.1a0/firepfn/model/__init__.py +5 -0
- firepfn-0.0.1a0/firepfn/model/_mamba_block.py +49 -0
- firepfn-0.0.1a0/firepfn/model/backbone.py +110 -0
- firepfn-0.0.1a0/firepfn/model/cross_attention.py +123 -0
- firepfn-0.0.1a0/firepfn/model/deltanet.py +134 -0
- firepfn-0.0.1a0/firepfn/model/fire_pfn.py +396 -0
- firepfn-0.0.1a0/firepfn/model/fla_autotune.py +73 -0
- firepfn-0.0.1a0/firepfn/model/hydra2.py +537 -0
- firepfn-0.0.1a0/firepfn/model/int32_safe.py +122 -0
- firepfn-0.0.1a0/firepfn/model/kumo.py +704 -0
- firepfn-0.0.1a0/firepfn/model/linear_attention.py +167 -0
- firepfn-0.0.1a0/firepfn/model/stream_infer.py +568 -0
- firepfn-0.0.1a0/firepfn/model/triton_rmsnorm.py +119 -0
- firepfn-0.0.1a0/firepfn/model/triton_rope.py +152 -0
- firepfn-0.0.1a0/firepfn/preprocessing.py +301 -0
- firepfn-0.0.1a0/firepfn/train/__init__.py +3 -0
- firepfn-0.0.1a0/firepfn/train/__main__.py +57 -0
- firepfn-0.0.1a0/firepfn/train/_tabicl_dataset.py +1762 -0
- firepfn-0.0.1a0/firepfn/train/configs.py +113 -0
- firepfn-0.0.1a0/firepfn/train/loop.py +224 -0
- firepfn-0.0.1a0/firepfn/train/optim.py +109 -0
- firepfn-0.0.1a0/firepfn/train/prior.py +74 -0
- firepfn-0.0.1a0/firepfn/train/schedule.py +125 -0
- firepfn-0.0.1a0/pyproject.toml +87 -0
- firepfn-0.0.1a0/setup.cfg +4 -0
- firepfn-0.0.1a0/tests/test_classifier.py +188 -0
- firepfn-0.0.1a0/tests/test_smoke.py +65 -0
firepfn-0.0.1a0/AUTHORS
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Felix Koch
|
|
2
|
+
TH Rosenheim, Rosenheim, Germany
|
|
3
|
+
|
|
4
|
+
Sasa Mladenovic
|
|
5
|
+
Lip6, Sorbonne University, Paris, France
|
|
6
|
+
|
|
7
|
+
Marius Lindauer
|
|
8
|
+
Leibniz University Hannover, Hannover, Germany
|
|
9
|
+
|
|
10
|
+
Benjamin Tischler
|
|
11
|
+
TH Rosenheim, Rosenheim, Germany
|
|
12
|
+
|
|
13
|
+
Marcel Wever
|
|
14
|
+
Leibniz University Hannover, Hannover, Germany
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: FirePFN
|
|
3
|
+
Version: 0.0.1a0
|
|
4
|
+
Summary: FirePFN: tabular foundation model -- frozen Kumo-Tabular row encoder + bidirectional SSM / linear-attention backbone
|
|
5
|
+
Author: The FirePFN authors
|
|
6
|
+
License-Expression: BSD-3-Clause AND Apache-2.0 AND MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/LUH-AI/FirePFN
|
|
8
|
+
Requires-Python: <3.14,>=3.12
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
License-File: AUTHORS
|
|
13
|
+
License-File: LICENSES/Apache-2.0.txt
|
|
14
|
+
License-File: LICENSES/BSD-3-Clause-TabICL.txt
|
|
15
|
+
License-File: LICENSES/MIT-Hydra.txt
|
|
16
|
+
License-File: LICENSES/OpenMDW-1.1-Kumo-Tabular-weights.txt
|
|
17
|
+
Requires-Dist: torch>=2.9.1
|
|
18
|
+
Requires-Dist: numpy>=1.26
|
|
19
|
+
Requires-Dist: scikit-learn>=1.4
|
|
20
|
+
Requires-Dist: einops
|
|
21
|
+
Requires-Dist: flash-linear-attention>=0.4.1
|
|
22
|
+
Requires-Dist: huggingface-hub
|
|
23
|
+
Requires-Dist: mamba-ssm>=2.3.2; sys_platform == "linux"
|
|
24
|
+
Provides-Extra: train
|
|
25
|
+
Requires-Dist: tabicl==2.2.0; extra == "train"
|
|
26
|
+
Requires-Dist: wandb>=0.25; extra == "train"
|
|
27
|
+
Provides-Extra: eval
|
|
28
|
+
Requires-Dist: pandas>=2.0; extra == "eval"
|
|
29
|
+
Requires-Dist: matplotlib>=3.8; extra == "eval"
|
|
30
|
+
Requires-Dist: openml>=0.15; extra == "eval"
|
|
31
|
+
Requires-Dist: adjustText>=1.0; extra == "eval"
|
|
32
|
+
Requires-Dist: bencheval; extra == "eval"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# FirePFN: Fast In-Context Representation Encoding <img alt="FirePFN logo" src="assets/firepfn-logo.png" align="right" height="250px">
|
|
36
|
+
|
|
37
|
+
[Felix Koch](https://github.com/felixmkoch), [Sasa Mladenovic](https://github.com/sasa-ml), Marius Lindauer, Benjamin Tischler, and [Marcel Wever](https://github.com/mwever). *FirePFN: Fast In-Context Representation Encoding for Scaling PFNs.* Arxiv 2026
|
|
38
|
+
|
|
39
|
+
FirePFN is a tabular foundation model for in-context classification. A frozen, pretrained
|
|
40
|
+
Kumo-Tabular table encoder (NVIDIA) embeds every row. A 6-block backbone mixes the context rows:
|
|
41
|
+
bidirectional Mamba-3 SSM, gated linear attention and Gated DeltaNet blocks. Query rows then read the context through a cross-attention
|
|
42
|
+
with a length-aware temperature, and a decoder predicts up to 10 classes; more classes are handled
|
|
43
|
+
by a balanced class tree with at most 10 classes per node. The model was trained only on synthetic tables from the TabICLv2
|
|
44
|
+
`graph_scm` prior. Its cost is linear in the number of context rows, and it handles millions of
|
|
45
|
+
rows on one GPU.
|
|
46
|
+
|
|
47
|
+
## Install
|
|
48
|
+
|
|
49
|
+
**Requirements:** Linux, an NVIDIA GPU with CUDA (the model runs Triton and Mamba kernels), and
|
|
50
|
+
Python 3.12 or 3.13.
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 1. a fresh environment
|
|
54
|
+
python -m venv .venv && source .venv/bin/activate
|
|
55
|
+
|
|
56
|
+
# 2. PyTorch >= 2.9.1, CUDA build (pick the command for your CUDA version on pytorch.org)
|
|
57
|
+
pip install "torch>=2.9.1"
|
|
58
|
+
|
|
59
|
+
# 3. mamba-ssm >= 2.3.2 (Mamba-3 kernels), built against the installed torch
|
|
60
|
+
pip install "mamba-ssm>=2.3.2" --no-build-isolation
|
|
61
|
+
|
|
62
|
+
# 4. FirePFN from PyPI (--pre: the current releases are alpha versions)
|
|
63
|
+
pip install --pre FirePFN
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
For the latest development version, install from GitHub instead:
|
|
67
|
+
`pip install git+https://github.com/LUH-AI/FirePFN`.
|
|
68
|
+
|
|
69
|
+
Building mamba-ssm from source takes a while. A prebuilt wheel from the
|
|
70
|
+
[mamba releases](https://github.com/state-spaces/mamba/releases) that matches your Python, torch
|
|
71
|
+
and CUDA versions is faster: `pip install <wheel-url>` before step 4.
|
|
72
|
+
|
|
73
|
+
**Model weights.** The checkpoint is hosted at
|
|
74
|
+
[huggingface.co/LUHAI/FirePFN](https://huggingface.co/LUHAI/FirePFN). `FirePFNClassifier()` downloads
|
|
75
|
+
it on first use and caches it (`~/.cache/huggingface`, or `$HF_HOME`). On machines without
|
|
76
|
+
internet access, download `fire-pfn.ckpt` beforehand and pass `model_path="fire-pfn.ckpt"` or set
|
|
77
|
+
`FIREPFN_MODEL_PATH`:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
huggingface-cli download LUHAI/FirePFN fire-pfn.ckpt --local-dir .
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Check the install:**
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
python -c "
|
|
87
|
+
from sklearn.datasets import load_breast_cancer
|
|
88
|
+
from sklearn.model_selection import train_test_split
|
|
89
|
+
from firepfn import FirePFNClassifier
|
|
90
|
+
X, y = load_breast_cancer(return_X_y=True)
|
|
91
|
+
X_tr, X_te, y_tr, y_te = train_test_split(X, y, random_state=0)
|
|
92
|
+
print('accuracy:', FirePFNClassifier().fit(X_tr, y_tr).score(X_te, y_te))
|
|
93
|
+
"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Extras: `FirePFN[train]` for training and `FirePFN[eval]` for the benchmarks (see
|
|
97
|
+
[Training](#training) and [Evaluation](#evaluation)).
|
|
98
|
+
|
|
99
|
+
## Usage
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from firepfn import FirePFNClassifier
|
|
103
|
+
|
|
104
|
+
clf = FirePFNClassifier() # downloads the released weights from Hugging Face on first use
|
|
105
|
+
clf.fit(X_train, y_train)
|
|
106
|
+
proba = clf.predict_proba(X_test)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
A walk-through (binary and multiclass tasks, missing values, DataFrames with categorical columns,
|
|
110
|
+
more than 10 classes, cross-validation, options) is in
|
|
111
|
+
[examples/firepfn_classifier.ipynb](examples/firepfn_classifier.ipynb), also as a plain script:
|
|
112
|
+
`python examples/firepfn_classifier.py`.
|
|
113
|
+
|
|
114
|
+
The weights are hosted at [huggingface.co/LUHAI/FirePFN](https://huggingface.co/LUHAI/FirePFN) and
|
|
115
|
+
cached by `huggingface_hub` after the first download. Pass `model_path=...` (or set
|
|
116
|
+
`FIREPFN_MODEL_PATH`) to use a local checkpoint instead.
|
|
117
|
+
|
|
118
|
+
Defaults (the protocol of the shipped `results/`, except the ensemble size: see
|
|
119
|
+
[Evaluation](#evaluation)): at most 200 features (ANOVA F-score
|
|
120
|
+
selection, scored on at most 20k stratified training rows: `feature_selection="f_classif_sub"`),
|
|
121
|
+
at most 100,000 context rows (a stratified random subset of larger training sets:
|
|
122
|
+
`max_context_rows=100_000`; `None` uses every row), two ensemble members, softmax temperature 1.0,
|
|
123
|
+
bf16. More than 10 classes: `many_class_strategy="tree"` (default; a balanced class tree, fast), `"ecoc"`
|
|
124
|
+
(error-correcting output codes: slightly more accurate, about 3x slower) or `"ovr"`. See `FirePFNClassifier`'s
|
|
125
|
+
docstring for the options (ensembling, many-class strategies).
|
|
126
|
+
|
|
127
|
+
`FirePFNClassifier` takes numeric arrays (NaN allowed). For pandas DataFrames with categorical or
|
|
128
|
+
string columns, wrap it:
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
from firepfn.encoding import make_dataframe_classifier
|
|
132
|
+
|
|
133
|
+
clf = make_dataframe_classifier(FirePFNClassifier())
|
|
134
|
+
clf.fit(X_train_df, y_train)
|
|
135
|
+
proba = clf.predict_proba(X_test_df)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
On binary tasks, categorical columns with more than 500 distinct training values are replaced by
|
|
139
|
+
their out-of-fold target encoding, except date/time-like columns and entity-ID-like columns (levels
|
|
140
|
+
repeat and the label is almost constant within a level; under grouped splits their target
|
|
141
|
+
encoding would leak the label). `target_encode_min_levels=None` turns target encoding off,
|
|
142
|
+
`skip_id_like=False` the ID guard, `target_encode_binary_only=False` applies it to multiclass
|
|
143
|
+
tasks too (one column per class). All other non-numeric columns are ordinal-encoded.
|
|
144
|
+
|
|
145
|
+
### Very large training sets
|
|
146
|
+
|
|
147
|
+
With `max_context_rows=None`, FirePFN uses every training row as context. Above 262,144 context
|
|
148
|
+
rows it switches to a memory-bounded streaming mode. The model processes the rows in chunks, and the
|
|
149
|
+
predictions are the same as without streaming up to float summation order. Its GPU memory then grows
|
|
150
|
+
with a single buffer of 4 KiB per context row: one ensemble member, at 20 features, reaches about
|
|
151
|
+
242 GB at 56M rows. When that buffer, plus 40 GiB of working memory, does not fit into the GPU
|
|
152
|
+
memory still free, FirePFN keeps it in page-locked host memory instead and copies one block of rows
|
|
153
|
+
to the GPU at a time. The predictions are bit-identical, and the run is about 25-30% slower. On one
|
|
154
|
+
B300 at 20 features, this happens from about 58M rows on: 64M / 96M / 100M / 128M / 150M / 256M /
|
|
155
|
+
450M rows then take 968 / 1449 / 1512 / 1934 / 2271 / 3943 / 7027 s at 29 / 34 / 35 / 45 / 53 / 90 /
|
|
156
|
+
64 GB of GPU memory. The host needs the buffer's size in free RAM: 244 / 366 / 381 / 488 / 572 / 977 /
|
|
157
|
+
1717 GiB at 64M / 96M / 100M / 128M / 150M / 256M / 450M rows, so host RAM sets the limit: 450M rows
|
|
158
|
+
used about 1.8 TiB of the B300 node's 2 TiB. Wider tables, smaller or shared GPUs, and further ensemble members, whose buffers stay on the GPU for
|
|
159
|
+
prediction, switch earlier.
|
|
160
|
+
|
|
161
|
+
Environment variables:
|
|
162
|
+
|
|
163
|
+
| variable | default | effect |
|
|
164
|
+
|---|---|---|
|
|
165
|
+
| `FIREPFN_STREAM_CTX_ROWS` | `262144` | streaming mode above this many context rows; `0` disables it |
|
|
166
|
+
| `FIREPFN_STREAM_OFFLOAD` | `auto` | `auto`: host memory only when needed; `1`: always (in streaming mode); `0`: never |
|
|
167
|
+
| `FIREPFN_STREAM_OFFLOAD_MARGIN_GB` | `40` | GPU memory kept free for working memory in the `auto` decision |
|
|
168
|
+
| `FIREPFN_STREAM_OFFLOAD_PIN` | `1` | `0`: keep the host buffer pageable (slower copies) |
|
|
169
|
+
| `FIREPFN_STREAM_OFFLOAD_PIN_CHUNK_GB` | `256` | page-lock the host buffer in pieces of at most this size (CUDA rejects one piece above 512 GiB) |
|
|
170
|
+
| `FIREPFN_GPU_CAP_GB` | unset | act as if the GPU had this much memory (e.g. to test smaller cards) |
|
|
171
|
+
|
|
172
|
+
## Training
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
pip install --pre "FirePFN[train]"
|
|
176
|
+
# stage 1: from scratch (Kumo-Tabular encoder downloaded from Hugging Face and frozen), 4 GPUs
|
|
177
|
+
torchrun --nproc_per_node=4 -m firepfn.train --config stage1 --out runs/stage1
|
|
178
|
+
# stage 2: context-bucket schedule up to 32768 context rows, 8 GPUs
|
|
179
|
+
torchrun --nproc_per_node=8 -m firepfn.train --config stage2 --out runs/stage2 \
|
|
180
|
+
--init runs/stage1/stage1_epoch1000.ckpt
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Stage 2 was run for three 250-epoch cosine learning-rate cycles, each continuing from the
|
|
184
|
+
previous cycle's final model (`stage2`, then `stage2_cyc2` and `stage2_cyc3` at peak lr 5e-5):
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
torchrun --nproc_per_node=8 -m firepfn.train --config stage2_cyc2 --out runs/stage2_cyc2 \
|
|
188
|
+
--init runs/stage2/stage2_epoch250.ckpt
|
|
189
|
+
torchrun --nproc_per_node=8 -m firepfn.train --config stage2_cyc3 --out runs/stage2_cyc3 \
|
|
190
|
+
--init runs/stage2_cyc2/stage2_cyc2_epoch250.ckpt
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Training uses only synthetic tables from the TabICLv2 `graph_scm` prior. The released checkpoint
|
|
194
|
+
is the final model of `stage2_cyc3` (epoch 250). See `firepfn/train/configs.py` for all
|
|
195
|
+
hyperparameters.
|
|
196
|
+
|
|
197
|
+
## Evaluation
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
# TabArena and bencheval are not on PyPI: install them first
|
|
201
|
+
pip install "tabarena @ git+https://github.com/autogluon/tabarena.git@1a394bd1d4e656c2834ac0b3c4cf0db9ed105400#subdirectory=tabarena"
|
|
202
|
+
pip install "bencheval @ git+https://github.com/autogluon/tabarena.git@1a394bd1d4e656c2834ac0b3c4cf0db9ed105400#subdirectory=bencheval"
|
|
203
|
+
pip install --pre "FirePFN[eval]"
|
|
204
|
+
|
|
205
|
+
# TabArena classification tasks (OpenML suite 457), official splits; resumes from --output
|
|
206
|
+
python -m firepfn.eval.tabarena prefetch # needs internet; fills the OpenML cache
|
|
207
|
+
python -m firepfn.eval.tabarena run --output my_results/tabarena.csv
|
|
208
|
+
# defaults = protocol of the shipped results/ (te500 + ID guard, f_classif_sub, 100k context
|
|
209
|
+
# cap, T=1.0); --no-target-encode / --no-id-guard switch the encoding steps off
|
|
210
|
+
|
|
211
|
+
# fit + predict time and peak GPU memory vs. context rows (paper: 20 / 200 / 500 features);
|
|
212
|
+
# runs without the 100k context cap, i.e. on the full context
|
|
213
|
+
python -m firepfn.eval.runtime --n-features 20 --output my_results/runtime_f20.csv
|
|
214
|
+
|
|
215
|
+
# leaderboard (CSV + LaTeX) and plots; your rows replace the shipped FirePFN rows of the same name
|
|
216
|
+
python -m firepfn.eval.analysis benchmark --results results/tabarena/*.csv my_results/tabarena.csv --out out/tabarena
|
|
217
|
+
python -m firepfn.eval.analysis runtime --results results/runtime/*.csv my_results/runtime_f*.csv --out out/runtime
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
`results/` holds the per-split results of the paper for FirePFN and the baselines (CatBoost,
|
|
221
|
+
XGBoost, RandomForest, TabPFNv2.5, TabPFN 3.5 Fast, TabICLv1/v2, TabDPT 1.3, Kumo-Tabular Small,
|
|
222
|
+
Inpriora, Seldon-Mini, LightPFN 1.5), all run with the same harness:
|
|
223
|
+
|
|
224
|
+
| Directory | Benchmark | Classification tasks | Splits per task |
|
|
225
|
+
|---|---|---|---|
|
|
226
|
+
| `results/tabarena/` | TabArena (OpenML suite 457) | 38 | 3 folds x up to 3 repeats |
|
|
227
|
+
| `results/talent/` | TALENT | 200 | 1 |
|
|
228
|
+
| `results/beyondarena/` | BeyondArena (random, grouped and temporal splits) | 98 | up to 5 repeats x 3 folds |
|
|
229
|
+
| `results/ramanbench/` | RamanBench | 21 | 3 folds |
|
|
230
|
+
| `results/runtime/` | runtime scaling (20 / 200 / 500 features, up to 20M rows; at 20 features FirePFN up to 450M rows, CatBoost and XGBoost up to 256M rows) | -- | -- |
|
|
231
|
+
|
|
232
|
+
All raw results were obtained with single estimators only, for FirePFN and the baselines alike:
|
|
233
|
+
FirePFN with `n_estimators=1` (one ensemble member, not the default of two), every
|
|
234
|
+
foundation-model baseline (TabPFN, TabICL, TabDPT, Inpriora, Seldon, LightPFN, Kumo) with one
|
|
235
|
+
ensemble member instead of its package default, and CatBoost, XGBoost and RandomForest as one
|
|
236
|
+
fitted model each (no bagging or ensembling on top). The FirePFN rows are
|
|
237
|
+
otherwise the released checkpoint with the default settings above. The runtime rows were measured
|
|
238
|
+
with this package (`python -m firepfn.eval.runtime`, released checkpoint) with `n_estimators=1`
|
|
239
|
+
and without the context cap. In `results/runtime/fire-pfn.csv`, `host_offload` marks the rows that
|
|
240
|
+
kept the context buffer in host memory (64M rows and up), and `host_buffer_gib` gives that buffer's
|
|
241
|
+
size; their `peak_gpu_mem_gb` does not include it. `streaming` marks the rows encoded by the
|
|
242
|
+
streaming context path (more than 262,144 rows), and `token_recompute` the rows where the encoder's
|
|
243
|
+
full token buffer no longer fit on the GPU, so the encoder recomputed its column summaries in extra
|
|
244
|
+
passes over the context (16M rows and up at 20 features, 4M and up at 200 / 500 features; markedly
|
|
245
|
+
slower per row). These two columns were added after the runs, from the code's thresholds and the
|
|
246
|
+
drop in peak GPU memory; `python -m firepfn.eval.runtime` now records all four itself. The 128M, 150M, 256M and 450M
|
|
247
|
+
rows are marked `over_budget` (fit + predict above 30 minutes); they are valid measurements.
|
|
248
|
+
At 20 features, CatBoost, XGBoost, TabPFNv2.5, TabPFN 3.5 Fast, TabDPT 1.3 and Kumo-Tabular Small
|
|
249
|
+
were continued past their first over-30-minute size with a 2 h per-run budget (and 15 instead of
|
|
250
|
+
14 CPU cores for the added rows); their rows above 30 minutes are likewise marked `over_budget`.
|
|
251
|
+
The TabPFN 3.5 Fast run at 8M rows completed but returned degenerate predictions (ROC AUC 0.5,
|
|
252
|
+
noted in `error`); its timing is kept.
|
|
253
|
+
|
|
254
|
+
Splits a method could not run (out of memory, time limit, class limit) are filled with
|
|
255
|
+
RandomForest's scores, as on the TabArena leaderboard; the analysis reports how many. The leaderboard
|
|
256
|
+
(improvability, Elo calibrated to RandomForest = 1000, win rate, mean rank, with bootstrap intervals)
|
|
257
|
+
is computed by TabArena's `bencheval` package. Runtimes are reported as on tabarena.ai: the median
|
|
258
|
+
over tasks of the train time per 1K training rows and of the inference time per 1K test rows,
|
|
259
|
+
over the tasks every model ran itself. The same
|
|
260
|
+
`benchmark` analysis works for every benchmark directory:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
for B in tabarena talent beyondarena ramanbench; do
|
|
264
|
+
python -m firepfn.eval.analysis benchmark --results results/$B/*.csv --out out/$B
|
|
265
|
+
done
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
This package runs FirePFN on TabArena and the runtime grid; it does not run the baselines, and
|
|
269
|
+
it ships results only (no runner) for TALENT, BeyondArena and RamanBench.
|
|
270
|
+
|
|
271
|
+
## License
|
|
272
|
+
|
|
273
|
+
The code is BSD-3-Clause ([LICENSE](LICENSE)). A few files contain third-party code under
|
|
274
|
+
Apache-2.0, MIT or BSD-3-Clause (TabICL); see [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md) and [NOTICE](NOTICE).
|
|
275
|
+
The trained FirePFN weights are also BSD-3-Clause. The released checkpoints additionally contain
|
|
276
|
+
NVIDIA's frozen Kumo-Tabular encoder (the `table_encoder.*` parameters, about 10M of 55.7M), which
|
|
277
|
+
stays under [OpenMDW-1.1](LICENSES/OpenMDW-1.1-Kumo-Tabular-weights.txt).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
AUTHORS
|
|
2
|
+
LICENSE
|
|
3
|
+
NOTICE
|
|
4
|
+
README.md
|
|
5
|
+
pyproject.toml
|
|
6
|
+
FirePFN.egg-info/PKG-INFO
|
|
7
|
+
FirePFN.egg-info/SOURCES.txt
|
|
8
|
+
FirePFN.egg-info/dependency_links.txt
|
|
9
|
+
FirePFN.egg-info/requires.txt
|
|
10
|
+
FirePFN.egg-info/top_level.txt
|
|
11
|
+
LICENSES/Apache-2.0.txt
|
|
12
|
+
LICENSES/BSD-3-Clause-TabICL.txt
|
|
13
|
+
LICENSES/MIT-Hydra.txt
|
|
14
|
+
LICENSES/OpenMDW-1.1-Kumo-Tabular-weights.txt
|
|
15
|
+
firepfn/__init__.py
|
|
16
|
+
firepfn/class_tree.py
|
|
17
|
+
firepfn/classifier.py
|
|
18
|
+
firepfn/encoding.py
|
|
19
|
+
firepfn/ensemble.py
|
|
20
|
+
firepfn/loading.py
|
|
21
|
+
firepfn/many_class.py
|
|
22
|
+
firepfn/preprocessing.py
|
|
23
|
+
firepfn/eval/__init__.py
|
|
24
|
+
firepfn/eval/analysis.py
|
|
25
|
+
firepfn/eval/plots.py
|
|
26
|
+
firepfn/eval/runtime.py
|
|
27
|
+
firepfn/eval/tabarena.py
|
|
28
|
+
firepfn/model/__init__.py
|
|
29
|
+
firepfn/model/_mamba_block.py
|
|
30
|
+
firepfn/model/backbone.py
|
|
31
|
+
firepfn/model/cross_attention.py
|
|
32
|
+
firepfn/model/deltanet.py
|
|
33
|
+
firepfn/model/fire_pfn.py
|
|
34
|
+
firepfn/model/fla_autotune.py
|
|
35
|
+
firepfn/model/hydra2.py
|
|
36
|
+
firepfn/model/int32_safe.py
|
|
37
|
+
firepfn/model/kumo.py
|
|
38
|
+
firepfn/model/linear_attention.py
|
|
39
|
+
firepfn/model/stream_infer.py
|
|
40
|
+
firepfn/model/triton_rmsnorm.py
|
|
41
|
+
firepfn/model/triton_rope.py
|
|
42
|
+
firepfn/train/__init__.py
|
|
43
|
+
firepfn/train/__main__.py
|
|
44
|
+
firepfn/train/_tabicl_dataset.py
|
|
45
|
+
firepfn/train/configs.py
|
|
46
|
+
firepfn/train/loop.py
|
|
47
|
+
firepfn/train/optim.py
|
|
48
|
+
firepfn/train/prior.py
|
|
49
|
+
firepfn/train/schedule.py
|
|
50
|
+
tests/test_classifier.py
|
|
51
|
+
tests/test_smoke.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
torch>=2.9.1
|
|
2
|
+
numpy>=1.26
|
|
3
|
+
scikit-learn>=1.4
|
|
4
|
+
einops
|
|
5
|
+
flash-linear-attention>=0.4.1
|
|
6
|
+
huggingface-hub
|
|
7
|
+
|
|
8
|
+
[:sys_platform == "linux"]
|
|
9
|
+
mamba-ssm>=2.3.2
|
|
10
|
+
|
|
11
|
+
[eval]
|
|
12
|
+
pandas>=2.0
|
|
13
|
+
matplotlib>=3.8
|
|
14
|
+
openml>=0.15
|
|
15
|
+
adjustText>=1.0
|
|
16
|
+
bencheval
|
|
17
|
+
|
|
18
|
+
[train]
|
|
19
|
+
tabicl==2.2.0
|
|
20
|
+
wandb>=0.25
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
firepfn
|
firepfn-0.0.1a0/LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026, the FirePFN authors (see AUTHORS)
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
This license applies to all files in this repository EXCEPT those that carry an SPDX header
|
|
7
|
+
naming a different license. Those files are third-party code (or derived from it) and remain
|
|
8
|
+
under their original licenses; see THIRD_PARTY_LICENSES.md and the texts in LICENSES/.
|
|
9
|
+
|
|
10
|
+
Redistribution and use in source and binary forms, with or without
|
|
11
|
+
modification, are permitted provided that the following conditions are met:
|
|
12
|
+
|
|
13
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
14
|
+
list of conditions and the following disclaimer.
|
|
15
|
+
|
|
16
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
17
|
+
this list of conditions and the following disclaimer in the documentation
|
|
18
|
+
and/or other materials provided with the distribution.
|
|
19
|
+
|
|
20
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
21
|
+
contributors may be used to endorse or promote products derived from
|
|
22
|
+
this software without specific prior written permission.
|
|
23
|
+
|
|
24
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
25
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
26
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
27
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
28
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
29
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
30
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
31
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
32
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
33
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|