SIGN IN SIGN UP

[OLMoE] Update expected logits for A10G and add torch.no_grad() (#47989)

* [OLMoE] Update expected logits for A10G and add torch.no_grad()

Expected values in test_model_7b_logits were stale (3/8 mean elements
mismatched). Updated to values captured on A10G. Also added
torch.no_grad() consistent with other integration tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix OLMo2/OLMo3 slow test failures (OOM + stale logits)

- Add `tearDownClass` to `Olmo3InternalIntegrationTest` and
  `Olmo3IntegrationTest` so each class's model is freed before the
  next class loads, preventing VRAM exhaustion (~14 GB per 7B model)
- Add `with torch.no_grad():` to all forward-pass calls in OLMo2 and
  OLMo3 integration tests
- Update stale expected logit values for OLMo2-1B and OLMo3-Internal
  (shanearora/2025-sep-a-base-model) to match current model outputs
- Fix `Olmo3IntegrationTest::test_real_model_7b_greedy_generation_batched`
  expected value: batched generation with unequal-length prompts
  produces an empty response for the shorter (padded) item
- Fix `test_generate_beyond_sliding_window` expected: model outputs
  ASCII apostrophe in "you've", not the curly U+2019 that was hardcoded

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* [OLMo3] Fix batched generation test: use left padding + update expected output

The tokenizer defaults to right padding, which causes the shorter padded
sequence to generate EOS immediately after "assistant\n", producing an
empty response. Setting padding_side="left" (required for decoder-only
batched generation) produces proper output for both sequences. Update
item[1] expected value accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Y
Yih-Dar committed
bd5df99aecf6a4a2be1e44f32892101c0352d7f9
Parent: c7ad728
Committed by GitHub <noreply@github.com> on 8/15/2026, 5:56:16 PM