Commit 8d66dba
perf(dataloader): rejection-sample negatives instead of setdiff per proof
`build_training_examples` was calling `setdiff(all_premises_pool, used_names)`
once per proof_state — on the 138k/56k-unique corpus that is ~8 GB of
fresh `Vector{String}` allocations before training can start. Cold
training stalled for 10+ minutes in GC before epoch 1.
Sample-and-reject from the pool instead: for each proof, draw
`num_negatives × 8` attempts, skipping anything in `used_set` or already
picked. Same distribution, O(num_negatives) per call, no per-proof
allocation of the negative pool.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 7d107b1 commit 8d66dba
1 file changed
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| 226 | + | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
245 | 263 | | |
246 | 264 | | |
247 | 265 | | |
| |||
0 commit comments