# Kubeflow PyTorch

## Directory

### Classes

| Class | Description |
|-|-|
| [`flytekitplugins.kfpytorch.task.CleanPodPolicy`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskcleanpodpolicy) | CleanPodPolicy describes how to deal with pods when the job is finished. |
| [`flytekitplugins.kfpytorch.task.Elastic`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskelastic) | Configuration for [`torch elastic training`](https://pytorch. |
| [`flytekitplugins.kfpytorch.task.ElasticWorkerResult`](flytekitplugins.kfpytorch.task#flytekitpluginskfpytorchtaskelasticworkerresult) | A named tuple representing the result of a torch elastic worker process. |
| [`flytekitplugins.kfpytorch.task.Master`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskmaster) | Configuration for master replica group. |
| [`flytekitplugins.kfpytorch.task.PyTorch`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskpytorch) | Configuration for an executable [`PyTorch Job`](https://github. |
| [`flytekitplugins.kfpytorch.task.PyTorchFunctionTask`](flytekitplugins.kfpytorch.task#flytekitpluginskfpytorchtaskpytorchfunctiontask) | Plugin that submits a PyTorchJob (see https://github. |
| [`flytekitplugins.kfpytorch.task.PytorchElasticFunctionTask`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskpytorchelasticfunctiontask) | Plugin for distributed training with torch elastic/torchrun (see. |
| [`flytekitplugins.kfpytorch.task.RestartPolicy`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskrestartpolicy) | RestartPolicy describes how the replicas should be restarted. |
| [`flytekitplugins.kfpytorch.task.RunPolicy`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskrunpolicy) | RunPolicy describes some policy to apply to the execution of a kubeflow job. |
| [`flytekitplugins.kfpytorch.task.Worker`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#flytekitpluginskfpytorchtaskworker) |  |

### Functions

| Function | Description |
|-|-|
| [`flytekitplugins.kfpytorch.error_handling.create_recoverable_error_file()`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.error_handling/page.md#create_recoverable_error_file) | Create a file to signal to the agent process that an exception in the worker process is recoverable. |
| [`flytekitplugins.kfpytorch.error_handling.is_recoverable_worker_error()`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.error_handling/page.md#is_recoverable_worker_error) | Check if the error in the worker process is recoverable. |
| [`flytekitplugins.kfpytorch.pod_template.add_shared_mem_volume_to_pod_template()`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.pod_template/page.md#add_shared_mem_volume_to_pod_template) | Add shared memory volume and volume mount to the pod template. |
| [`flytekitplugins.kfpytorch.task.spawn_helper()`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md#spawn_helper) | Help to spawn worker processes. |

### Packages

| Package | Description |
|-|-|
| [`flytekitplugins.kfpytorch.error_handling`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.error_handling/page.md) | Handle errors in elastic training jobs. |
| [`flytekitplugins.kfpytorch.pod_template`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.pod_template/page.md) |  |
| [`flytekitplugins.kfpytorch.task`](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md) | This Plugin adds the capability of running distributed pytorch training to Flyte using backend plugins, natively on. |

## Subpages

- [flytekitplugins.kfpytorch.error_handling](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.error_handling/page.md)
  - Directory
  - Methods
  - Variables
  - Methods
- [flytekitplugins.kfpytorch.pod_template](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.pod_template/page.md)
  - Directory
  - Methods
  - Methods
- [flytekitplugins.kfpytorch.task](https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/flytekitplugins.kfpytorch.task/page.md)
  - Directory
  - Classes
  - Methods
  - Variables
  - Methods
  - flytekitplugins.kfpytorch.task.CleanPodPolicy
  - flytekitplugins.kfpytorch.task.Elastic
  - Parameters
  - flytekitplugins.kfpytorch.task.ElasticWorkerResult
  - flytekitplugins.kfpytorch.task.Master
  - Parameters
  - flytekitplugins.kfpytorch.task.PyTorch
  - Parameters
  - flytekitplugins.kfpytorch.task.PyTorchFunctionTask
  - Parameters
  - Properties
  - Methods
  - flytekitplugins.kfpytorch.task.PytorchElasticFunctionTask
  - Parameters
  - Properties
  - Methods
  - flytekitplugins.kfpytorch.task.RestartPolicy
  - flytekitplugins.kfpytorch.task.RunPolicy
  - Parameters
  - flytekitplugins.kfpytorch.task.Worker
  - Parameters

---
**Source**: https://github.com/unionai/unionai-docs/blob/main/content/api-reference/plugins/kf-pytorch/_index.md
**HTML**: https://www.union.ai/docs/v1/flyte/api-reference/plugins/kf-pytorch/
