Manytasks
A lightweight tool for deploying many tasks automatically, without any modification to your code.
Installation
I recommend you install from github to get the newest features:
pip install git+https://github.com/dugu9sword/manytasks.git
You can also install the package (maybe outdated) from pypi:
pip install manytasks [not recommended]
Quick Example
cd examples/python
# configuration is stored in tasks.json
manytasks run tasks
All running logs are stored in tasks.logs.
-
The running log of the manytasks is written into
task.logs/status.txt -
The IO stream of tasks (e.g.
print(),Exception,Error, ...) are redirected totask.logs/task-[index].txt.
Sample Configuration
For more complex cases, see ADVANCED_CASES.md.
{
"executor": "python some.py",
"cuda": [4, 5, 6, 7],
"concurrency": 4, # num of tasks to run in parallel
"cuda_per_task": 1,
"configs": {
# basic configurations
"==base==": [
"arg0",
"--a", [50, 100], # `--a` takes value from [50, 100]
"--name", "a_${a}" # "${a}" refers to the value of `--a`
],
# more disjoint configurations
"==more==": [
[ "--c1", [1, 2] ], # [1, 2]
[ "--c2", "$<x|y>.$<1:4>" ], # [x.1, x.2, x.3, y.1, y.2, y.3]
]
}
}
which yields:
--- ---- --- ------ ---- ----
idx __1 --a --name --c1 --c2
0 arg0 50 a_50 1 -
1 arg0 50 a_50 2 -
2 arg0 100 a_100 1 -
3 arg0 100 a_100 2 -
4 arg0 50 a_50 - x.1
5 arg0 50 a_50 - x.2
6 arg0 50 a_50 - x.3
7 arg0 50 a_50 - y.1
8 arg0 50 a_50 - y.2
9 arg0 50 a_50 - y.3
10 arg0 100 a_100 - x.1
11 arg0 100 a_100 - x.2
12 arg0 100 a_100 - x.3
13 arg0 100 a_100 - y.1
14 arg0 100 a_100 - y.2
15 arg0 100 a_100 - y.3
--- ---- --- ------ ---- ----
Syntax Sugar
The syntax sugar makes the enumeration of arguments more easier.
| Type | Example Input | Example Output |
|---|---|---|
| list | $<1:6> |
[1, 2, 3, 4, 5] |
| list (with step) | $<1:6:2> |
[1, 3, 5] |
| list (with zero-pad) | $<1:6:2;3> |
[001, 003, 005] |
| files | $<files:/home/*.py> |
[/home/foo.py, /home/bar.py, ...] |
| files (without path) | $<files:/home/*.py;nameonly> |
[foo.py, bar.py, ...] |
| lines | $<lines:urls.txt> |
[baidu.com, google.com, ...] |
| set | $<a|b|c> |
[a, b, c] |
| composition | x_$<1:3;3>.txt |
[x_001.txt, x_002.txt] |
| composition (more) | logs/$<a|b>.$<1:3> |
[logs/a.1, logs/a.2, logs/b.1, logs/b.2] |
Design Philosophy
Q: Why not use other open-source tools for hyper-parameter tuning, such as optuna, hydra, wandb?
A: The first time I developed this tool is 2019-1-1, when most of those tools (except optuna) were not born yet. What's more,
- These tools are heavy, which means:
- You need to modify your code (add several lines of
import xxx; xxx.foo(); xxx.bar();) to integrate their functionalities. - You may have to replace your
print(...)orlog(...)function with theirs, sometimes your results may be logged to their server. - These tools are highly binded with
python, which means they may fail if your code is written inperl(such asmosetokenizerin machine translation),bash(such as your code for preprocessing), etc.
- You need to modify your code (add several lines of
manytasksis a lightweight tool which helps you deploy many tasks without any modification to your code, all logs will be saved in your machine.
Q:When should you use other open-source tools for hyper-parameter tuning, such as optuna, hydra, wandb?
A: For complex cases when you would like to enjoy their power of hyper-parameter tuning.
Analysis
See Analysis.md.
History
See History.md.
Metadata
Release files for manytasks 2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| manytasks-2.3.tar.gz | 15.2 kB | Without provenance | Details for manytasks-2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| manytasks-2.3-py3-none-any.whl | Python 3 | none | any | Details for manytasks-2.3-py3-none-any.whl |
Total release size: 30.8 kB
Release files / manytasks-2.3.tar.gz
| Download URL | manytasks-2.3.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd4f2fb03e8f682efb79b1118d92f557e704d70b14554d788f1a4ff91b255b55
|
|
BLAKE2b-256 checksum How to use checksums |
76f468b02de96feb56d5ca6187c605d64078d7bf76a4cf1190e2d775c550fc84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.28.0 setuptools/61.2.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.13
|
Release files / manytasks-2.3-py3-none-any.whl
| Download URL | manytasks-2.3-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
119aff9735636b9728bd66bdd8f50d1b7679f709f0d615ecf913944b780cf352
|
|
BLAKE2b-256 checksum How to use checksums |
057b04da896edf72231006ec1ebac2cbd0e3612c97f8b899ccee37780cf4e5d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.28.0 setuptools/61.2.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.8.13
|
Security for manytasks 2.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.