镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Changed tune.report import for ray>=2 - #1392

Merged
Li Jiang (thinkall) merged 16 commits into
microsoft:mainfrom
Evotec-isRD:ray-2-report
Feb 14, 2025
Merged

Li Jiang (thinkall) merged 16 commits into
microsoft:mainfrom
Evotec-isRD:ray-2-report

Conversation

@drwillcharles

Copy link
Copy Markdown
Contributor

Why are these changes needed?

When using ray>=2, there is an import error for tune.report.

AttributeError: module 'ray.tune' has no attribute 'report'

I used the Ray migration guide to update this and use the new report function if the ray version is not 1.x .

I see that in the FLAML codebase there are already a few workarounds like this so I think I can do something similar without needing a full migration to Ray 2.x

Related issue number

Related to #874 - although I still think a full migration to Ray>=2 is needed in the future.

Checks

@drwillcharles

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree company="Evotec"

@thinkall Li Jiang (thinkall) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Will Charles (@drwillcharles) , for the PR!

@thinkall

Copy link
Copy Markdown
Collaborator

Hi Will Charles (@drwillcharles) , could you check the test errors? Looks like the change will lead to test timeout issue. Thanks.

@drwillcharles

Copy link
Copy Markdown
Contributor Author

It appears the test _test_hf_data() on test_gpu.py gets stuck in a loop because of an error in Ray. Strangely - this test is not even run because of the naming convention. (_test_hf_data() instead of test_hf_data()).

I have loosened the pydantic dependency and hope this solves the issue.

@drwillcharles

Copy link
Copy Markdown
Contributor Author

OpenML is currently down so a lot of tests are getting connection errors. Will wait until this is back online before I resume development.

From the tests that have run successfully, it appears there are still some environment issues to fix

@drwillcharles

Copy link
Copy Markdown
Contributor Author

I've figured out that the jobs are timing out because Ray cannot find the appropriate resource
image

There is a function _test_hf_data in test/test_gpu.py which I don't think is even picked up in the tests (because of the underscore).
However, when running this file, it gets stuck in an infinite loop. I think before this just failed silently.

Can I delete this?

@thinkall

Copy link
Copy Markdown
Collaborator

I've figured out that the jobs are timing out because Ray cannot find the appropriate resource image

There is a function _test_hf_data in test/test_gpu.py which I don't think is even picked up in the tests (because of the underscore). However, when running this file, it gets stuck in an infinite loop. I think before this just failed silently.

Can I delete this?

Sorry for the late reply, Will Charles (@drwillcharles). It's interesting that this underscored test is picked up. For bypassing the test, I think we can detect whether there is a GPU resource and skip the test if None. WDYT? Thanks.

@drwillcharles

Will Charles (drwillcharles) commented Feb 11, 2025 •

Copy link
Copy Markdown
Contributor Author

No problem Li Jiang (@thinkall). I did add a check for the GPU resource and even deleted the test to check. Turns out I was wrong and the problem appears to be test_lrl2 on test_model.py.

Looking at the line lr.fit(X, y, budget=1e-5) it appears the test should just stop when the budget is exceeded (almost instantaneous). However, that appears not to be happening. I have not yet found a solution to this and it appears #1402 is having the same problem in the tests.

@thinkall

Copy link
Copy Markdown
Collaborator

No problem Li Jiang (@thinkall). I did add a check for the GPU resource and even deleted the test to check. Turns out I was wrong and the problem appears to be test_lrl2 on test_model.py.

Looking at the line lr.fit(X, y, budget=1e-5) it appears the test should just stop when the budget is exceeded (almost instantaneous). However, that appears not to be happening. I have not yet found a solution to this and it appears #1402 is having the same problem in the tests.

Thank you for pointing out the root cause test, Will Charles (@drwillcharles) . I fixed the tests in #1406 .

@drwillcharles

Copy link
Copy Markdown
Contributor Author

No problem Li Jiang (@thinkall). I did add a check for the GPU resource and even deleted the test to check. Turns out I was wrong and the problem appears to be test_lrl2 on test_model.py.
Looking at the line lr.fit(X, y, budget=1e-5) it appears the test should just stop when the budget is exceeded (almost instantaneous). However, that appears not to be happening. I have not yet found a solution to this and it appears #1402 is having the same problem in the tests.

Thank you for pointing out the root cause test, Will Charles (@drwillcharles) . I fixed the tests in #1406 .

Thanks Li Jiang (@thinkall) ! I have implemented your fix so hopefully these tests pass now 🤞

@thinkall
Li Jiang (thinkall) merged commit 840f76e into microsoft:main Feb 14, 2025
@drwillcharles
Will Charles (drwillcharles) deleted the ray-2-report branch February 14, 2025 09:53
@thinkall Li Jiang (thinkall) mentioned this pull request Aug 6, 2025
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants