-
-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python3Packages.torcheval: init at 0.0.7 #376129
Conversation
Fixes: #376031 |
12f241b
to
53b19a6
Compare
i think torchtnt should be declared as on its own library so that nixpkgs users have access to both libraries |
@osbm That version of torchtnt is unlikely to be of great to use outside of this package. |
Alternatively, I could patch / correct a codepath that makes use of the breaking change in --- a/torcheval/tools/module_summary.py
+++ b/torcheval/tools/module_summary.py
@@ -29,7 +29,7 @@ from torch.utils._pytree import PyTree, tree_flatten
from torch.utils.hooks import RemovableHandle
from torchtnt.utils import Timer
-from torchtnt.utils.version import is_torch_version_geq_1_13
+from torchtnt.utils.version import is_torch_version_geq
from typing_extensions import Literal
_ATTRIB_TO_COL_HEADER = {
@@ -242,7 +242,7 @@ def _get_module_flops_and_activation_sizes(
module_kwargs = module_kwargs or {}
flops_forward = None
flops_backward = None
- if not is_torch_version_geq_1_13():
+ if not is_torch_version_geq("1.13.0"):
warnings.warn(
"Please install PyTorch 1.13 or higher to compute FLOPs: https://pytorch.org/get-started/locally/"
)
|
It would actually be awesome to open pull requests on these upstream repositories first, if they get added quickly nixpkgs would never have to deal with these. Can you open these PRs or should i? I am talking about the both patches of torcheval and your patch of torchtnt. |
@osbm unfortunately, while this patch does let the tests run, it reveals further breaking changes down the line, including the removal of The usage of forward_elapsed_time_handles = _register_hooks(
module,
[
(_forward_time_pre_hook(forward_timer_mapping), _HookType.FORWARD_PRE_HOOK), # call to Timer.start
(
_forward_time_hook(forward_timer_mapping, forward_elapsed_times_sec), # call to Timer.stop
_HookType.FORWARD_HOOK,
),
],
)
...
for hook_handle in forward_elapsed_time_handles:
hook_handle.remove() At that point it would be better to wait for Until then, I think I'll submit this package. |
I have some scripts i can test it. But for that you need to add this package to the If you can also add me to the maintainer list to this package i can help update/maintain it in the future. |
@osbm I've added the relevant entry to |
The newest push stems from an updated comment that documents why the tests disabled in 27fb1ae cannot work, even if they are granted filesystem access. |
b609a14
to
fb05836
Compare
Using { torchtnt-nightly }:
buildPythonPackage {
# ...
dependencies = [
torchtnt-nightly
typing-extensions
];
} > =========================== short test summary info ============================
> ERROR tests/tools/test_flops.py
> ERROR tests/tools/test_module_summary.py
> !!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
> ================== 1 deselected, 1 warning, 2 errors in 1.63s ==================
error: build of '/nix/store/1jx7cmyhhrpx52ryq93463m718sdnki6-python3.12-torcheval-0.0.6.drv' on 'ssh-ng://rosetta-builder' failed: builder for '/nix/store/1jx7cmyhhrpx52ryq93463m718sdnki6-python3.12-torcheval-0.0.6.drv' failed with exit code 2;
last 25 log lines:
> E ImportError: cannot import name 'is_torch_version_geq_1_13' from 'torchtnt.utils.version' (/nix/store/mhzrnmh20f4kild55i233yzg71ywy24d-python3.12-torchtnt-nightly-2024.8.1/lib/python3.12/site-packages/torchtnt/utils/version.py) When overriden to use the version I had picked out, the tests pass. { torchtnt-nightly }:
let
torchtnt = torchtnt-nightly.overridePythonAttrs rec {
pname = "torchtnt-nightly";
version = "2023.1.25";
src = fetchPypi {
inherit pname version;
hash = "sha256-eFouZgdVQaqrXIKLY7geLV8GEVPGu6IHKIPK6aLJH8w=";
};
};
in
buildPythonPackage {
# ...
dependencies = [
torchtnt
typing-extensions
];
} $ nix-build -A python3Packages.torcheval --system aarch64-linux
/nix/store/sxcy8l7isk1ynxhg406zvkymv58d1lx6-python3.12-torcheval-0.0.6 |
@bengsparks have you tried reaching upstream? |
@GaetanLepage I think waiting for torcheval 0.0.7 on GitHub is the correct move then. (I have, since my work here, come to understand that Nix cannot fix package conflicts in Python). Alternatively I could package torcheval 0.0.7 from PyPI, but there are no tests there. |
Well, I think you could wait for a long time. |
801454c
to
0effacd
Compare
|
Tests are missing the |
27fffba
to
6f0f318
Compare
nixpkgs-review is failing on my system due to reasons unrelated to this PR, so I'm currently unable to test locally. |
As this is a leaf package, you don't really need |
6f0f318
to
29b9e15
Compare
6aa89f1
to
bb541cc
Compare
bb541cc
to
72395f0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
|
A library that contains a rich collection of performant PyTorch model metrics, a simple interface to create new metrics, a toolkit to facilitate metric computation in distributed training and tools for PyTorch model evaluations.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.