You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
petals/tests
Alexander Borzunov 8f6342a861
Refactor RemoteSequenceManager (#309)
This PR:

1. **Extracts `SequenceManagerConfig` and `SequenceManagerState` subclasses.**

    The config is provided by caller and never changed from inside `RemoteSequenceManager`. The state is a part of the `RemoteSequenceManager`'s state shared between the main manager and its slices. We fix some slicing bugs along the way.

2. **Removes `dht_prefix` and `p2p` arguments, makes `dht` argument optional.**

    `dht_prefix` can always be overridden using `config.dht_prefix`. `p2p` actually needed only under the hood of `RemoteSequenceManager`, so it can extract it by itself without exposing this low-level class to callers. If strictly necessary, a caller can provide `p2p` as a part of `SequenceManagerState`. `dht` is also needed only by `RemoteSequenceManager`, so we can make it optional in the parent classes and create it automatically when it's not provided.

3. **Simplifies retry logic.**

    Previously, we could have "nested" retry loops: one in `._update()`, another in inference/forward/backward steps. The loop in `._update()` could introduce issues to concurrent inference/forward/backward calls, since it blocks the entire class if its delay period becomes too high. Now this logic is simplified: `._update()` performs only one attempt to fetch the DHT info, any retries are triggered by the inference/forward/backward steps.

4. **Removes deprecated `RemoteTransformerBlock`.**

    `RemoteTransformerBlock` was deprecated a long time ago, before Petals 1.0.0. Its removal is long due.

5. **Removes `dht_utils.get_remote_module()`, `dht_utils.get_remote_sequence()`.**

    This functions duplicate the functionality of the `RemoteSequential` constructor.

6. (minor) **Removes `RemoteSequential.is_subsequence` flag.**

    This flag worked incorrectly and was never used. I am removing it for the sake of simplicity.
1 year ago
..
scripts Fix arguments in remove_old_models.py (#153) 2 years ago
conftest.py Fix logging: do not duplicate lines, enable colors in Colab (#156) 2 years ago
test.id Add automated tests (#23) 2 years ago
test_aux_functions.py Speed up loading blocks using init with meta weights (#285) 1 year ago
test_block_exact_match.py Refactor RemoteSequenceManager (#309) 1 year ago
test_chained_calls.py Refactor RemoteSequenceManager (#309) 1 year ago
test_full_model.py Speed up loading blocks using init with meta weights (#285) 1 year ago
test_priority_pool.py Fix issues related to `petals` as a module (#159) 2 years ago
test_remote_sequential.py Refactor RemoteSequenceManager (#309) 1 year ago
test_sequence_manager.py Refactor RemoteSequenceManager (#309) 1 year ago
test_server_stats.py Refactor RemoteSequenceManager (#309) 1 year ago
test_tensor_parallel.py Speed up loading blocks using init with meta weights (#285) 1 year ago
test_utils.py Implement RemoteSequential slicing and extra repr, add tests (#30) 2 years ago