pytorch-lightning

Форк
0
49 строк · 1.8 Кб
1
# Copyright The Lightning AI team.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
# you may not use this file except in compliance with the License.
5
# You may obtain a copy of the License at
6
#
7
#     http://www.apache.org/licenses/LICENSE-2.0
8
#
9
# Unless required by applicable law or agreed to in writing, software
10
# distributed under the License is distributed on an "AS IS" BASIS,
11
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14

15
from typing import TYPE_CHECKING, List, Optional
16

17
from lightning.app.core.queues import QueuingSystem
18
from lightning.app.runners.backends import Backend
19
from lightning.app.utilities.network import LightningClient
20

21
if TYPE_CHECKING:
22
    import lightning.app
23

24

25
class CloudBackend(Backend):
26
    def __init__(
27
        self,
28
        entrypoint_file,
29
        queue_id: Optional[str] = None,
30
        status_update_interval: Optional[int] = None,
31
        client_max_tries: Optional[int] = None,
32
    ):
33
        super().__init__(entrypoint_file, queues=QueuingSystem.MULTIPROCESS, queue_id=queue_id)
34
        self.client = LightningClient(max_tries=client_max_tries)
35

36
    def create_work(self, app: "lightning.app.LightningApp", work: "lightning.app.LightningWork") -> None:
37
        raise NotImplementedError
38

39
    def update_work_statuses(self, works: List["lightning.app.LightningWork"]) -> None:
40
        raise NotImplementedError
41

42
    def stop_all_works(self, works: List["lightning.app.LightningWork"]) -> None:
43
        raise NotImplementedError
44

45
    def resolve_url(self, app, base_url: Optional[str] = None) -> None:
46
        raise NotImplementedError
47

48
    def stop_work(self, app: "lightning.app.LightningApp", work: "lightning.app.LightningWork") -> None:
49
        raise NotImplementedError
50

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.