You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: bart fp16 engine is wrong at max_sequence_length 1024; bart-large-cnn cannot be loaded and forced_bos_token_id is ignored #2046
Model and revision:facebook/bart-base @ aadd2ab0ae0c8268c7c9693540e9904811f36177 (manifest model); facebook/bart-large-cnn @ 37f520fa929c961707657b28798b30c003dd100b
Three findings in families/bart, recorded in the FP8 study section of families/bart/README.md (#2004, section 8). They are independent of FP8.
fp16 at max_sequence_length 1024 gives wrong logits. The encoder output matches Transformers (cosine at least 0.9998); the decoder output does not. At 256 the same models are correct (bart-large-cnn KL 0.0005, top-1 98.2%; bart-base KL 6e-8). CNN/DailyMail 3.0.0 test articles, truncated to 1024 tokens, teacher-forced KL and top-1 agreement against Transformers fp32:
Model, fp16, 1024
Articles
KL
Top-1
Greedy equal
ROUGE-1 (Transformers fp32)
bart-large-cnn, forced BOS, B200
300
4.78
49.4%
11.0%
10.7 (27.5)
bart-large-cnn, forced BOS, B300
300
4.79
49.4%
11.0%
10.8 (27.5)
bart-base, B200
20
3.02
42.3%
0%
-
512 and an fp32 build at 1024 were not measured. The manifests use 256, so CI does not cover 1024.
forced_bos_token_id is not applied.bart-large-cnn sets forced_bos_token_id: 0 in its generation config; the bundle runtime config takes only eos_token_id from it. (With the token forced in a test harness, item 1 is still wrong at 1024, so the two problems are separate.)
facebook/bart-large-cnn cannot be loaded. Its safetensors store the shared token table only as model.decoder.embed_tokens.weight, and the loader stops with:
BART: cannot find shared embedding weight
Minimal reproducer
Build facebook/bart-base (revision above) in fp16 with max_sequence_length 1024 and with 256; run the decoder teacher-forced on CNN/DailyMail test articles and compare the logits with Transformers fp32: 1024 gives KL about 3, 256 matches.
Activity