Skip to main content

HyperPod elastic agent

The HyperPod elastic agent is an extension of PyTorch’s ElasticAgent. It orchestrates lifecycles of training workers on each container and communicates with the HyperPod training operator. To use the HyperPod training operator, you must first install the HyperPod elastic agent into your training image before you can submit and run jobs using the operator. The following is a docker file that installs elastic agent and uses hyperpodrun to create the job launcher. For more information about the HyperPod training operator, installation of the operator, and how to use it, see the official AWS documentation.

RUN pip install hyperpod-elastic-agent

ENTRYPOINT ["entrypoint.sh"]
# entrypoint.sh
...
hyperpodrun --nnodes=node_count --nproc-per-node=proc_count \
            --rdzv-backend hyperpod \ # Optional
            ... # Other torchrun args
            # pre-traing arg_group
            --pre-train-script pre.sh --pre-train-args "pre_1 pre_2 pre_3" \
            # post-train arg_group
            --post-train-script post.sh --post-train-args "post_1 post_2 post_3" \
            training.py --script-args

You can now submit jobs with kubectl.

Note: When invoking hyperpodrun in a container entrypoint, ensure that hyperpodrun is PID 1 or alternatively is able to receive signals(specifically SIGTERM) forwared from PID 1 in the container to allow graceful termination during container/pod teardown. This can be done in the following ways:

  • Use exec when specifying ENTRYPOINT in shell mode, for ex: ENTRYPOINT exec hyperpodrun .....
  • Use exec format to speicify the container entrypoint, for ex: ENTRYPOINT ["hyperpodrun", .....]
  • Use an init process that can forward signals to its child processes, for ex: tini

HyperPod elastic agent arguments

The HyperPod elastic agent supports all of the original arguments from the PyTorch Elastic Agent official documentation. The following is a list of additional arguments available in the HyperPod elastic agent:

Argument Description Default Value
--shutdown-signal Signal to send to workers for shutdown (SIGTERM or SIGKILL) "SIGKILL"
--shutdown-timeout Timeout in seconds between SIGTERM and SIGKILL signals 15
--server-host Agent server address "0.0.0.0"
--server-port Agent server port 8080
--server-log-level Agent server log level "info"
--server-shutdown-timeout Server shutdown timeout in seconds 300
--pre-train-script Path to pre-training script None
--pre-train-args Arguments for pre-training script None
--post-train-script Path to post-training script None
--post-train-args Arguments for post-training script None
--inprocess-restart Flag specifying whether to use the inprocess_restart feature false
--inprocess-timeout Time in seconds the Agent waits for workers to come to barrier before triggering a process level restart None

Metadata

Release files for hyperpod-elastic-agent 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hyperpod-elastic-agent 1.1.3
File Size Uploaded Provenance
hyperpod_elastic_agent-1.1.3.tar.gz 103.0 kB Without provenance Details

Release files / hyperpod_elastic_agent-1.1.3.tar.gz

Download URL hyperpod_elastic_agent-1.1.3.tar.gz
Size 103.0 kB
Tags Source
SHA-256 checksum
How to use checksums
f4b54e4df691b2c309a231213a773f85162eba5f5e241a35f51444faf6d9e925
BLAKE2b-256 checksum
How to use checksums
9be39127e239cbf372704367baae70b38c975f6258d480086104bdcf3aea45b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for hyperpod-elastic-agent 1.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page