Skip to content

Commit

Permalink
More thorough PTS testing (#1784)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #1784

Background: Jelena somehow noticed that D46519588 could break PTS because an unused argument was being passed and ignored, which D46519588 would disallow. See https://fburl.com/diff/ttaw0v83

It turns out that there are _two or three_ reasons that unit tests would not have caught this issue:
* There was no sufficiently end-to-end test for usage of FBModels.BOPE and FBModels.BOPE_MTGP; we never "gen" based on them
* "gen" is mocked out in the analyzer tests, so we wouldn't have caught those errors anyway
* Exceptions are logged rather than raised, so without careful testing, the exception raised wouldn't have triggered a test breakage.

Changes: So we need 1) a test that combines FBModels.BOPE and FBModels.BOPE with actually generating candidates (perhaps with fast_botorch_optimize), and 2) better testing in PTSAnalyzer and perhaps other parts of PTS in general.

I attempted to add (1) and remove the mock of "gen", but I'm haaving a hard time due to my lack of familiarity with PTS. Help writing these tests would be very appreciated!

Reviewed By: lena-kashtelyan

Differential Revision: D48288094

fbshipit-source-id: a0cb5009657eff70f5e9dcac9cf4d636e4c5eaf9
  • Loading branch information
esantorella authored and facebook-github-bot committed Aug 17, 2023
1 parent 6c8f653 commit 07eb671
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ax/models/torch/alebo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def __init__(self, B: Tensor, batch_shape: torch.Size) -> None:
)
# pyre-fixme[4]: Attribute must be annotated.
self.d, D = B.shape
assert self.d < D
if not self.d < D:
raise ValueError(f"Expected B.shape[0] < B.shape[1], but got {B.shape=}.")
self.B = B
# Initialize U
Arnd = torch.randn(D, D, dtype=B.dtype, device=B.device)
Expand Down

0 comments on commit 07eb671

Please sign in to comment.