Hectiq Lab

Upgrade from pyhectiqlab

The same work, in hectiqlab.

hectiqlab records to the same Hectiq Lab as pyhectiqlab, with a smaller API: one way to do each thing, and no call that can crash your training. Both packages install side by side and share the same key, so you can move one script at a time.

pip install "hectiqlab[cli]"

A training script

from pyhectiqlab import Run, Step, Config
import pyhectiqlab.functional as hl

hl.set_project("hectiq-ai/demo")

with Run(title="My first run"):
    hl.add_config(Config(lr=1e-3, epochs=3))
    with Step(name="train"):
        for epoch in range(3):
            hl.add_metric(key="loss", step=epoch, value=train_one_epoch())
    hl.add_artifact(path="confusion.png")
    hl.create_model(name="my-model", path="checkpoints/")

Call by call

pyhectiqlabhectiqlab
Run(title=...)hl.run(title)
hl.add_config(config)hl.run(title, config={...}), or hl.runs.update(config={...})
hl.retrieve_run(rank=42)hl.runs.get(42)
hl.add_metric(key=..., step=..., value=...)hl.add_metric(name, step=..., value=...)
Step(name=...), hl.start_step(...)hl.stage(name), hl.each(iterable, name)
hl.add_artifact(path=...)hl.artifacts.create(path)
hl.add_figure(figure=..., name=...)fig.savefig(path), then hl.artifacts.create(path)
hl.create_dataset(name=..., source=...)hl.datasets.create(path, name=...)
hl.download_dataset(name=..., version=...)hl.datasets.download(name, version)
hl.create_model(...), hl.download_model(...)hl.models.create(...), hl.models.download(name, version)
hl.add_tags_to_run(tags=[...])hl.runs.tag(*tags)
run.track_version([...])Nothing: every run records its commit, diff and packages.
hl.publish_message(...), hl.get_message(...)Nothing yet: hectiqlab has no messages.
ConfigA plain dict.

What changes in behavior

  • Failures are values. pyhectiqlab logged most errors and returned None. In hectiqlab, a read or change returns a Result: .unwrap() gives the value or raises. See Results and errors.
  • Nothing waits on the network. Metrics, stages and uploads go out in the background. The run waits for them before it ends, and warns once if something didn't land.
  • Runs are named by rank or id. hl.runs.get(42) reads run 42 of the project; a string is an id.
  • The run ends by itself. No more hl.completed() or hl.failed(): the run ends completed, failed or stopped with its block.

The command line

hectiq-lab Class.method --flag becomes hlab <thing> <verb>:

pyhectiqlabhectiqlab
hectiq-lab authenticatehlab login
hectiq-lab Run.retrieve --rank 42hlab run get 42
hectiq-lab Dataset.create --source data/ --name interactionshlab dataset create data/ --name interactions
hectiq-lab Model.download --name two-tower --version 1.3hlab model download two-tower --version 1.3
hectiq-lab Tag.listhlab tag list

Every hlab command takes --json.

Settings

pyhectiqlabhectiqlab
HECTIQLAB_OFFLINE_MODEHECTIQLAB_DISABLE
HECTIQLAB_HIDE_PROGRESSHECTIQLAB_PROGRESS=false
HECTIQLAB_RAISE_ERRORNothing: call .unwrap() on a Result, or run.result()
HECTIQLAB_API_KEY, HECTIQLAB_CREDENTIALS, HECTIQLAB_API_URL, HECTIQLAB_PROJECTThe same

See Settings for the rest.

On this page