Skip to main content

euler-connector

How the euler-* packages talk to euler-view: one source of truth for the connection.

When euler-view launches a job, it tells the job's processes where they belong and how they may reach it. A package reports through euler_connector and never handles that connection itself.

  • Transports. Records go to a file on the shared filesystem, which euler-view reads over SSH and which works on every cluster. Where compute nodes reach euler-view, they are also posted over HTTP.
  • Who speaks. Only rank 0 speaks for a job. Forked workers stay silent; workers started with torch.multiprocessing.spawn must set RANK.
  • Safety. Nothing ever blocks or breaks the run: no exceptions, no unbounded queues, and a daemon thread for the network.
  • Dependencies. None beyond the standard library (Python ≥ 3.9). tqdm is optional.

The first channel is structured progress. A record says what a counter counts (the whole run, one task, one epoch) and where the run is (task i of n, epoch e of E). euler-view can therefore show one overall percentage and ETA for training, inference and evaluation alike.

Install

pip install euler-connector          # or: euler-connector[tqdm]

Report progress

from euler_connector import progress

p = progress.start("inference")                       # train | inference | eval | preprocess | other

# A tqdm bar that also reports (same arguments as tqdm, plus `scope`):
for sample in progress.tqdm(samples, desc="Inference", scope="overall", unit="sample"):
    ...

p.close()              # done; a failed run calls p.close(done=False)

Without a bar:

p = progress.start("train")
for epoch in range(num_epochs):
    p.set_epoch(epoch + 1, num_epochs)                # 1-based
    for step, batch in enumerate(loader, 1):
        ...
        p.update(step, len(loader), scope="epoch", unit="step")
p.close()

Nested work, e.g. evaluating several datasets:

p = progress.start("eval")
for d, dataset in enumerate(datasets, 1):
    p.set_level("dataset", d, len(datasets), dataset.name)
    for t, task in enumerate(tasks_of(dataset), 1):
        p.set_task(t, None, task.name)                # the count may be unknown
        for sample in progress.tqdm(task.samples, desc=task.label):   # scope="task"
            ...

Records are written at most every 10 s. A new task, epoch or level is written at once, at most once per second.

p.update(current, total) counts the whole run unless given a scope (task, epoch, step); a bar counts one task unless given one. Positions are 1-based.

No call raises. A call progress cannot use, such as a 0-based position or an unknown scope, is ignored with a warning, so it never stops a run.

Several processes

Only the global rank 0 reports. The rank comes from RANK (set by torchrun and accelerate), OMPI_COMM_WORLD_RANK, PMI_RANK or SLURM_PROCID, else it is 0. Forked workers, such as DataLoader workers, stay silent.

Workers started with torch.multiprocessing.spawn must set RANK to their global rank before their first progress call (the connector reads it once). spawn sets no rank variable, so without it each worker counts as rank 0, and they overwrite each other's progress.

def train(rank, world_size):                  # spawn passes each worker its index
    os.environ["RANK"] = str(rank)            # on several nodes: node_rank * nprocs + rank
    p = progress.start("train")
    ...

torch.multiprocessing.spawn(train, args=(world_size,), nprocs=world_size)

The launch environment

euler-view sets these variables for every launch; outside euler-view nothing is sent.

Variable Meaning
EULER_LAUNCH_ID the launch
EULER_CONNECTOR_DIR where the file transport writes <channel>.json; it also holds the HTTP token
EULER_VIEW_BASE_URL set only where compute nodes reach euler-view: enables HTTP
EULER_CONNECTOR_MODE auto (default), file, http, off
EULER_CONNECTOR_INTERVAL seconds between records of one channel (default 10)

docs/protocol.md is the full protocol: the envelope, both transports, throttling, the progress schema, and how to add a channel.

For more uses

Progress is one domain module on a general base:

  • Connector: the process's connection, from the environment;
  • channels: named, each with a versioned payload schema;
  • transports: file, HTTP, memory, callback.

A new use (a heartbeat, a status, metrics from inference) adds a channel and a small module next to progress, and the package code stays one call. See "Adding a channel" in the protocol.

from euler_connector import connect

connector = connect()
print(connector.describe())    # enabled, launch, rank, transports and their health (no secrets)

Capability report

The package registers an euler.capabilities entry point, euler-connector (euler_connector.capabilities:capability_report), as every euler-* package does. Its connector_capability_report (1.0) says what the installed connector speaks: the protocol version, each channel with its schema version (progress: 1), the transports, the throttle, and the environment variables it reads (the launch environment above, the rank variables, the SLURM variables of the attempt). euler-suite report from euler-dataset-contract collects it; euler-view reads it per cluster environment. Building it reads no environment.

from euler_connector.capabilities import capability_report
capability_report()["channels"]   # {"progress": {"schema": 1, "stages": [...], "scopes": [...]}}

Development

uv sync --extra dev
uv run pytest

Metadata

Release files for euler-connector 0.2.0

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

Source distribution (sdist)

Source distribution for euler-connector 0.2.0
File Size Uploaded Provenance Actions
euler_connector-0.2.0.tar.gz 34.1 kB Without provenance Details for euler_connector-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for euler-connector 0.2.0
File Interpreter ABI Platform Actions
euler_connector-0.2.0-py3-none-any.whl Python 3 none any Details for euler_connector-0.2.0-py3-none-any.whl

Total release size: 63.7 kB

Release files / euler_connector-0.2.0.tar.gz

Download URL euler_connector-0.2.0.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ce3069e65df706190c356ecdd88dd405be0cc4c581039557e58b74e5ece74465
BLAKE2b-256 checksum
How to use checksums
675bbd98df862801ee41fe8bcce7972623364f42b915fdf639d47646c05ee49f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / euler_connector-0.2.0-py3-none-any.whl

Download URL euler_connector-0.2.0-py3-none-any.whl
Size 29.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
54987ab095e55f7a60b91b2d9f84fd7b75dca06e74e86bd407a807aa3e978d46
BLAKE2b-256 checksum
How to use checksums
c81d00010263cf59ad4f317a3cf951f42fddab71590cd7be3dec05ec190e8a9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for euler-connector 0.2.0

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