Skip to content

Conversation

@ltiao
Copy link
Contributor

@ltiao ltiao commented Aug 11, 2025

Summary:

Context

In the benchmarking set-up, the normalize_progression=True option in early-stopping strategies is currently not working properly as zero trials are early-stopped. Specifically, it appears that is_eligible_any returns False for all trials.

All early-stopping strategies (all subclasses of BaseEarlyStoppingStrategy) are impacted. Specifically the instantiation of MapData in the return call of _check_validity_and_get_data casts the progression column to int64, which rounds all the float-valued progressions [0.0, 1.0) to 0, leading is_eligible_any to always return False

Changes

This diff removes the specification of map_key_info as integer-typed in BenchmarkMapMetric and BenchmarkMapUnavailableWhileRunningMetric.

Differential Revision: D79938692

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 11, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79938692

ltiao added a commit to ltiao/Ax that referenced this pull request Aug 11, 2025
Summary:

### Context

In the benchmarking set-up, the `normalize_progression=True` option in early-stopping strategies is currently not working properly as zero trials are early-stopped. Specifically, it appears that `is_eligible_any` returns `False` for all trials. 

All early-stopping strategies (all subclasses of `BaseEarlyStoppingStrategy`) are impacted. Specifically the instantiation of `MapData` in the return call of `_check_validity_and_get_data` casts the progression column to `int64`, which rounds all the float-valued progressions `[0.0, 1.0)` to `0`, leading `is_eligible_any` to always return `False`

### Changes

This diff removes the specification of `map_key_info` as integer-typed in `BenchmarkMapMetric` and `BenchmarkMapUnavailableWhileRunningMetric`.

Differential Revision: D79938692
@ltiao ltiao force-pushed the export-D79938692 branch from a7d3214 to cfe771a Compare August 11, 2025 15:21
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79938692

ltiao added a commit to ltiao/Ax that referenced this pull request Aug 11, 2025
Summary:
Pull Request resolved: facebook#4126

### Context

In the benchmarking set-up, the `normalize_progression=True` option in early-stopping strategies is currently not working properly as zero trials are early-stopped. Specifically, it appears that `is_eligible_any` returns `False` for all trials.

All early-stopping strategies (all subclasses of `BaseEarlyStoppingStrategy`) are impacted. Specifically the instantiation of `MapData` in the return call of `_check_validity_and_get_data` casts the progression column to `int64`, which rounds all the float-valued progressions `[0.0, 1.0)` to `0`, leading `is_eligible_any` to always return `False`

### Changes

This diff removes the specification of `map_key_info` as integer-typed in `BenchmarkMapMetric` and `BenchmarkMapUnavailableWhileRunningMetric`.

Differential Revision: D79938692
@ltiao ltiao force-pushed the export-D79938692 branch from cfe771a to 82c74c1 Compare August 11, 2025 15:25
Summary:

### Context

In the benchmarking set-up, the `normalize_progression=True` option in early-stopping strategies is currently not working properly as zero trials are early-stopped. Specifically, it appears that `is_eligible_any` returns `False` for all trials.

All early-stopping strategies (all subclasses of `BaseEarlyStoppingStrategy`) are impacted. Specifically the instantiation of `MapData` in the return call of `_check_validity_and_get_data` casts the progression column to `int64`, which rounds all the float-valued progressions `[0.0, 1.0)` to `0`, leading `is_eligible_any` to always return `False`

### Changes

This diff removes the specification of `map_key_info` as integer-typed in `BenchmarkMapMetric` and `BenchmarkMapUnavailableWhileRunningMetric`.

Differential Revision: D79938692
@ltiao ltiao force-pushed the export-D79938692 branch from 82c74c1 to a788189 Compare August 11, 2025 15:34
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D79938692

@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.08%. Comparing base (3817cf3) to head (a788189).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4126      +/-   ##
==========================================
- Coverage   96.08%   96.08%   -0.01%     
==========================================
  Files         566      566              
  Lines       57226    57224       -2     
==========================================
- Hits        54988    54986       -2     
  Misses       2238     2238              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 67f0d60.

esantorella added a commit to esantorella/Ax that referenced this pull request Aug 18, 2025
Summary:
**Context**:

Map values must satisfy two properties:
* They need to be ordered such that it makes sense to take the largest value and modeled that or to sort on those values.
* They shouldn't be typed as ints, since as we learned in D79938692 / Ax facebook#4126, this can result in floats getting cast to ints later.
* They shouldn't be weird since they need to be serializable.

This leaves one obvious candidate: float. Fortunately, existing usages seem to be floats.

**This PR**:

* Makes all map keys floats
* Removes some type annotation logic that is now extraneous
* Renames a silly test class (I had used "TestMapDataXYZ" to make it easier to run several related groups of tests via CLI then forgot to change it back.)

Differential Revision: D80473359
facebook-github-bot pushed a commit that referenced this pull request Aug 18, 2025
Summary:
Pull Request resolved: #4164

**Context**:

Map values must satisfy two properties:
* They need to be ordered such that it makes sense to take the largest value and modeled that or to sort on those values.
* They shouldn't be typed as ints, since as we learned in D79938692 / Ax #4126, this can result in floats getting cast to ints later.
* They shouldn't be weird since they need to be serializable.

This leaves one obvious candidate: float. Fortunately, existing usages seem to be floats.

**This PR**:

* Makes all map keys floats
* Removes some type annotation logic that is now extraneous
* Renames a silly test class (I had used "TestMapDataXYZ" to make it easier to run several related groups of tests via CLI then forgot to change it back.)

Reviewed By: saitcakmak

Differential Revision: D80473359

fbshipit-source-id: 333bf0a97dfbfafa9e9921476b366b148812a3ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants