Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[TGA] Fix TGA Compatibility with Pytorch>=1.13 #4887

Merged
merged 1 commit into from Nov 21, 2022
Merged

Conversation

klshuster
Copy link
Contributor

Patch description
Seems pytorch>=1.13 is strict about accessing cpu tensors with gpu items; this PR fixes that.

Addresses #4869

Testing steps
Local testing, + running CI on pytorch 1.13 (which failed before)

$ pytest test_tga.py
=====test session starts =====
platform linux -- Python 3.9.15, pytest-5.3.2, py-1.11.0, pluggy-0.13.1
rootdir: /private/home/kshuster/ParlAI, inifile: pytest.ini
plugins: requests-mock-1.7.0, hydra-core-1.2.0, datadir-1.4.1, regressions-2.1.1
collected 8 items

test_tga.py ........                                                                                                                                                                                                                                                                                                                                                [100%]

===== slowest 10 test durations =====
2.89s call     tests/test_tga.py::TestTGA::test_block_full_context
2.88s call     tests/test_tga.py::TestTGA::test_no_greedy_largebeam
0.59s call     tests/test_tga.py::TestGeneration::test_token_level_loss_logging
0.22s call     tests/test_tga.py::TestGeneration::test_full_context_block
0.21s call     tests/test_tga.py::TestTGA::test_file_inference
0.13s call     tests/test_tga.py::TestGeneration::test_prefix_tokens
0.02s call     tests/test_tga.py::TestGeneration::test_tree_search

(0.00 durations hidden.  Use -vv to show these durations.)
=====8 passed, 13 warnings in 77.97s (0:01:17) =====

@klshuster klshuster merged commit bbdd64b into main Nov 21, 2022
@klshuster klshuster deleted the fix_hyp_id_device branch November 21, 2022 14:54
@drevicko
Copy link
Contributor

When can we expect to see this in a stable release?

@klshuster
Copy link
Contributor Author

I'm aiming to get in one more feature before a release compatible with pytorch 1.13 --> so, soon! Keep an eye out for it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants