Skip to main content

Tools for experimentation at MLO

Project description

EPFML Utilities

Internal tools for the MLO lab of EPFL.

Installation

 pip install epfml-utils

Add environment variables to your ~/.bashrc or equivalent file:

export EPFML_STORE_S3_ACCESS_KEY=""
export EPFML_STORE_S3_SECRET_KEY=""
export EPFML_STORE_S3_BUCKET=""
export EPFML_LDAP=""
# (Get those values from a friend.)
export EPFML_STORE_S3_ENDPOINT="https://s3.epfl.ch"

and make sure they are loaded:

source ~/.bashrc
echo $EPFML_LDAP  # Check if this prints your username.

Key-value store

This key-value store can help to transfer information between machines. Do not expect this to be fast or high-volume. Don't use this 100's of times in a training script.

Command-line usage

On one machine:

 epfml store set my_name "Bob"

On any other machine:

 epfml store get my_name
Bob

Python usage

import torch
import epfml.store

epfml.store.set("my_data", {"name": "Bob", "lab": "MLO"})
epfml.store.set("tensor", torch.zeros(4))
print(epfml.store.get("tensor"))
epfml.store.unset("tensor")
print(epfml.store.pop("my_data"))  # get and delete

Transporting code between machines

Packing

Upload a copy of the current working directory:

 epfml bundle pack
📦 Packaged and shipped.
⬇️ Unpack with `epfml bundle unpack mlotools_20230202_a205e830 -o .`.

To exclude (large / non-code) files from the package, add a config file to the directory

 epfml bundle init
📦 Default config file written to `/Users/vogels/epfl/mlotools/.epfml.bundle.toml`.

and customize it to your needs.

Unpacking

You can download the code into a directory:

 epfml bundle unpack mlotools_20230202_a205e830 -o some_directory

Or you can run a training script, or any other shell command, in a temporary check-out of the package:

 epfml bundle exec mlotools_20230202_a205e830 -- du -sh
🏃 Running inside a tmp clone of package `mlotools_20230202_a205e830`.
160K    .

Contributing

This repository is meant to be a collection of independent tools that each serve a simple well-defined purpose.

If you want to improve any of the tools in this repo, or contribute new tools. Take the following steps:

  1. Clone this repository.
  2. Initialize pre-commit: cd epfml-utils && pre-commit install (pip install pre-commit). This runs a couple of checks before you commit to keep this repo clean.
  3. Ask someone else to scrutinize your contributions. They can help you to improve the API and catch bugs. You can also check these very nice API design principles for tips.

To release a new version on PyPi, just increase the version number in pyproject.yoml and commit to Github.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epfml-utils-0.0.13.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epfml_utils-0.0.13-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file epfml-utils-0.0.13.tar.gz.

File metadata

  • Download URL: epfml-utils-0.0.13.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for epfml-utils-0.0.13.tar.gz
Algorithm Hash digest
SHA256 cae6704b2bbd8637194e7b45ce2e3b213b4838bc34b75de40e9d873cb184266e
MD5 d262adfe9031203b3f0857ab17820a86
BLAKE2b-256 a9e33e159ac47bbc1d61314f98f3d4671ddd7b926d84a21aa0eb6a34db049111

See more details on using hashes here.

File details

Details for the file epfml_utils-0.0.13-py3-none-any.whl.

File metadata

  • Download URL: epfml_utils-0.0.13-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for epfml_utils-0.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a475ff9b2774af12f420f9a690487a923895f8e0eec52b793c35e1435fa3ee
MD5 0596ead89e49bd391b87aa2bfd82a161
BLAKE2b-256 4592d8cb39414173215ef9d3b9f973e72839daecc1abae1e2b75901c889aea8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page