lightray 0.2.3__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. lightray-0.2.4/.flake8 +11 -0
  2. lightray-0.2.4/.github/workflows/charts.yaml +32 -0
  3. lightray-0.2.4/.github/workflows/pre-commit.yaml +17 -0
  4. lightray-0.2.4/.github/workflows/publish.yaml +27 -0
  5. lightray-0.2.4/.github/workflows/unit-tests.yaml +34 -0
  6. lightray-0.2.4/.gitignore +2 -0
  7. lightray-0.2.4/.pre-commit-config.yaml +26 -0
  8. {lightray-0.2.3 → lightray-0.2.4}/PKG-INFO +12 -21
  9. lightray-0.2.4/charts/raycluster/.helmignore +23 -0
  10. lightray-0.2.4/charts/raycluster/Chart.yaml +24 -0
  11. lightray-0.2.4/charts/raycluster/templates/external-service.yaml +13 -0
  12. lightray-0.2.4/charts/raycluster/templates/head-deployment.yaml +102 -0
  13. lightray-0.2.4/charts/raycluster/templates/internal-service.yaml +23 -0
  14. lightray-0.2.4/charts/raycluster/templates/secret.yaml +9 -0
  15. lightray-0.2.4/charts/raycluster/templates/ssh-secret.yaml +10 -0
  16. lightray-0.2.4/charts/raycluster/templates/worker-deployment.yaml +109 -0
  17. lightray-0.2.4/charts/raycluster/values.yaml +53 -0
  18. lightray-0.2.4/example/__init__.py +0 -0
  19. lightray-0.2.4/example/cli.yaml +20 -0
  20. lightray-0.2.4/example/example.yaml +54 -0
  21. lightray-0.2.4/example/lightning.py +78 -0
  22. lightray-0.2.4/example/run.sh +1 -0
  23. lightray-0.2.4/lightray/__init__.py +0 -0
  24. lightray-0.2.4/pyproject.toml +44 -0
  25. lightray-0.2.4/tests/test_cli.py +2 -0
  26. lightray-0.2.4/uv.lock +2562 -0
  27. lightray-0.2.3/pyproject.toml +0 -47
  28. {lightray-0.2.3 → lightray-0.2.4}/README.md +0 -0
  29. /lightray-0.2.3/lightray/__init__.py → /lightray-0.2.4/charts/raycluster/templates/NOTES.txt +0 -0
  30. {lightray-0.2.3 → lightray-0.2.4}/lightray/callbacks.py +0 -0
  31. {lightray-0.2.3 → lightray-0.2.4}/lightray/cli.py +0 -0
  32. {lightray-0.2.3 → lightray-0.2.4}/lightray/fs.py +0 -0
  33. {lightray-0.2.3 → lightray-0.2.4}/lightray/utils.py +0 -0
lightray-0.2.4/.flake8 ADDED
@@ -0,0 +1,11 @@
1
+ [flake8]
2
+ max-line-length = 79
3
+ max-complexity = 18
4
+ select = B,C,E,F,W,T4,B9
5
+ ignore = W503, E203 # ignore for consistency with black
6
+
7
+ # ignore asterisk imports and unused
8
+ # import errors in __init__ files
9
+ per-file-ignores =
10
+ **/__init__.py:F401,F403,E402
11
+
@@ -0,0 +1,32 @@
1
+ name: Release Charts
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths:
8
+ - 'charts/**'
9
+
10
+ jobs:
11
+ release:
12
+ permissions:
13
+ contents: write
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout
17
+ uses: actions/checkout@v3
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Configure Git
22
+ run: |
23
+ git config user.name "$GITHUB_ACTOR"
24
+ git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
25
+
26
+ - name: Install Helm
27
+ uses: azure/setup-helm@v3
28
+
29
+ - name: Run chart-releaser
30
+ uses: helm/chart-releaser-action@v1.6.0
31
+ env:
32
+ CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
@@ -0,0 +1,17 @@
1
+ name: pre-commit
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ pre-commit:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: actions/setup-python@v2
15
+ with:
16
+ python-version: "3.9"
17
+ - uses: pre-commit/action@v2.0.3
@@ -0,0 +1,27 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ environment: PyPI
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v3
16
+ with:
17
+ enable-cache: true
18
+ cache-dependency-glob: uv.lock
19
+
20
+ - name: Set up Python
21
+ run: uv python install 3.12
22
+
23
+ - name: Build
24
+ run: uv build
25
+
26
+ - name: Publish
27
+ run: uv publish -t ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,34 @@
1
+ name: unit-tests
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ['3.9', '3.10', '3.11']
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+
19
+ # set up our environment
20
+ -
21
+ name: Install Python
22
+ uses: actions/setup-python@v2
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ -
26
+ name: Install package
27
+ run: |
28
+ python -m pip install .
29
+ python -m pip install pytest
30
+
31
+ # run the library's tests
32
+ -
33
+ name: run tests
34
+ run: python -m pytest tests/
@@ -0,0 +1,2 @@
1
+ **/__pycache__
2
+ **/id_rsa
@@ -0,0 +1,26 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.9.6
4
+ hooks:
5
+ - id: ruff
6
+ args: [ --fix ]
7
+ - id: ruff-format
8
+ - repo: https://github.com/astral-sh/uv-pre-commit
9
+ # uv version.
10
+ rev: 0.6.0
11
+ hooks:
12
+ - id: uv-lock
13
+ - repo: https://github.com/pre-commit/pre-commit-hooks
14
+ rev: v2.3.0
15
+ hooks:
16
+ - id: end-of-file-fixer
17
+ - id: check-yaml
18
+ exclude: ^charts/raycluster/templates/
19
+ - repo: https://github.com/gruntwork-io/pre-commit
20
+ rev: v0.1.15
21
+ hooks:
22
+ - id: helmlint
23
+ - repo: https://github.com/dhruvmanila/remove-print-statements
24
+ rev: v0.5.2
25
+ hooks:
26
+ - id: remove-print-statements
@@ -1,25 +1,17 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: lightray
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: Distribute a LightningCLI hyperparameter search with Ray Tune
5
- License: MIT
6
- Author: Ethan Jacob Marx
7
- Author-email: ethan.marx@ligo.org
8
- Requires-Python: >=3.9,<4.0
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.9
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: jsonargparse[signatures] (>=4.33.2,<5.0.0)
17
- Requires-Dist: lightning (<=2.4.0)
18
- Requires-Dist: omegaconf (>=2.3.0,<3.0.0)
19
- Requires-Dist: pyarrow (>=17.0.0,<18.0.0)
20
- Requires-Dist: ray[default,tune] (>=2.8.0,<3.0.0)
21
- Requires-Dist: s3fs (>=2024.9.0,<2025.0.0)
22
- Requires-Dist: wandb (>=0.18.5,<0.19.0)
5
+ Author-email: Ethan Jacob Marx <ethan.marx@ligo.org>
6
+ License-Expression: MIT
7
+ Requires-Python: ~=3.9
8
+ Requires-Dist: jsonargparse[signatures]<5,>=4.33.2
9
+ Requires-Dist: lightning>=2.4.0
10
+ Requires-Dist: omegaconf<3,>=2.3.0
11
+ Requires-Dist: pyarrow<18,>=17.0.0
12
+ Requires-Dist: ray[default,tune]<3,>=2.8.0
13
+ Requires-Dist: s3fs<2025,>=2024.9.0
14
+ Requires-Dist: wandb<0.19,>=0.18.5
23
15
  Description-Content-Type: text/markdown
24
16
 
25
17
  # lightray
@@ -146,4 +138,3 @@ To connect to a remote ray cluster, pass the ip address (using port `10001`) to
146
138
  ```console
147
139
  lightray --config tune.yaml --ray_init.address ray://{ip}:10001 -- --config cli.yaml
148
140
  ```
149
-
@@ -0,0 +1,23 @@
1
+ # Patterns to ignore when building packages.
2
+ # This supports shell glob matching, relative path matching, and
3
+ # negation (prefixed with !). Only one pattern per line.
4
+ .DS_Store
5
+ # Common VCS dirs
6
+ .git/
7
+ .gitignore
8
+ .bzr/
9
+ .bzrignore
10
+ .hg/
11
+ .hgignore
12
+ .svn/
13
+ # Common backup files
14
+ *.swp
15
+ *.bak
16
+ *.tmp
17
+ *.orig
18
+ *~
19
+ # Various IDEs
20
+ .project
21
+ .idea/
22
+ *.tmproj
23
+ .vscode/
@@ -0,0 +1,24 @@
1
+ apiVersion: v2
2
+ name: ray-cluster
3
+ description: Deploy static ray clusters with Kubernetes.
4
+
5
+ # A chart can be either an 'application' or a 'library' chart.
6
+ #
7
+ # Application charts are a collection of templates that can be packaged into versioned archives
8
+ # to be deployed.
9
+ #
10
+ # Library charts provide useful utilities or functions for the chart developer. They're included as
11
+ # a dependency of application charts to inject those utilities and functions into the rendering
12
+ # pipeline. Library charts do not define any templates and therefore cannot be deployed.
13
+ type: application
14
+
15
+ # This is the chart version. This version number should be incremented each time you make changes
16
+ # to the chart and its templates, including the app version.
17
+ # Versions are expected to follow Semantic Versioning (https://semver.org/)
18
+ version: 0.1.6
19
+
20
+ # This is the version number of the application being deployed. This version number should be
21
+ # incremented each time you make changes to the application. Versions are not expected to
22
+ # follow Semantic Versioning. They should reflect the version the application is using.
23
+ # It is recommended to use it with quotes.
24
+ appVersion: "1.16.0"
@@ -0,0 +1,13 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: {{ .Release.Name }}-head-loadbalancer
5
+ spec:
6
+ ports:
7
+ - name: client
8
+ port: 10001
9
+ protocol: TCP
10
+ targetPort: 10001
11
+ selector:
12
+ app: {{ .Chart.Name }}-head
13
+ type: LoadBalancer
@@ -0,0 +1,102 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: {{ .Release.Name }}-head
5
+ labels:
6
+ app: {{ .Chart.Name }}-head
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ component: {{ .Chart.Name }}-head
12
+ type: ray
13
+ app: {{ .Chart.Name }}-head
14
+ template:
15
+ metadata:
16
+ labels:
17
+ component: {{ .Chart.Name }}-head
18
+ type: ray
19
+ app: {{ .Chart.Name }}-head
20
+ spec:
21
+ restartPolicy: Always
22
+ volumes:
23
+ - name: dshm
24
+ emptyDir:
25
+ medium: Memory
26
+ - name: {{ .Values.gitRepo.name }}-volume
27
+ emptyDir: {}
28
+ - name: {{ .Release.Name }}-git-secret
29
+ secret:
30
+ defaultMode: 0400
31
+ secretName: {{ .Release.Name }}-git-creds
32
+ securityContext:
33
+ fsGroup: 65533
34
+ {{- if .Values.dev }}
35
+ initContainers:
36
+ - name: git-sync
37
+ image: registry.k8s.io/git-sync/git-sync:v4.2.1
38
+ env:
39
+ - name: GITSYNC_REPO
40
+ value: {{ .Values.gitRepo.url }}
41
+ - name: GITSYNC_REF
42
+ value: {{ .Values.gitRepo.ref }}
43
+ - name: GITSYNC_ROOT
44
+ value: {{ .Values.gitRepo.mountPath }}
45
+ - name: GITSYNC_LINK
46
+ value: {{ .Values.gitRepo.name }}
47
+ - name: GITSYNC_ONE_TIME
48
+ value: "true"
49
+ - name: GITSYNC_SSH_KNOWN_HOSTS
50
+ value: "false"
51
+ - name: GITSYNC_SUBMODULES
52
+ value: "recursive"
53
+ - name: GITSYNC_ADD_USER
54
+ value: "true"
55
+ - name: GITSYNC_SYNC_TIMEOUT
56
+ value: "360s"
57
+ volumeMounts:
58
+ - name: {{ .Values.gitRepo.name }}-volume
59
+ mountPath: {{ .Values.gitRepo.mountPath }}
60
+ - name: {{ .Release.Name }}-git-secret
61
+ mountPath: /etc/git-secret
62
+ readOnly: true
63
+ securityContext:
64
+ runAsUser: 65533
65
+ {{- end }}
66
+ containers:
67
+ - name: ray-head
68
+ image: {{ .Values.image }}
69
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
70
+ command: [ "/bin/bash", "-c", "--" ]
71
+ args:
72
+ - "ray start --head --port=6380 --num-cpus=$MY_CPU_REQUEST --dashboard-host=0.0.0.0 --object-manager-port=8076 --node-manager-port=8077 --dashboard-agent-grpc-port=8078 --dashboard-agent-listen-port=52365 --block"
73
+ ports:
74
+ - containerPort: 6380
75
+ - containerPort: 10001
76
+ - containerPort: 8265
77
+ volumeMounts:
78
+ - mountPath: /dev/shm
79
+ name: dshm
80
+ - mountPath: {{ .Values.gitRepo.mountPath }}
81
+ name: {{ .Values.gitRepo.name }}-volume
82
+ env:
83
+ - name: TUNE_MAX_PENDING_TRIALS_PG
84
+ value: "64"
85
+ - name: MY_CPU_REQUEST
86
+ valueFrom:
87
+ resourceFieldRef:
88
+ resource: requests.cpu
89
+ - name: AWS_ENDPOINT_URL
90
+ value: {{ .Values.awsUrl }}
91
+ envFrom:
92
+ - secretRef:
93
+ name: {{ .Release.Name }}-credentials
94
+ resources:
95
+ limits:
96
+ cpu: {{ .Values.head.cpu | quote }}
97
+ memory: {{ .Values.head.memory | quote }}
98
+ ephemeral-storage: "100Gi"
99
+ requests:
100
+ cpu: {{ .Values.head.cpu | quote }}
101
+ memory: {{ .Values.head.memory | quote }}
102
+ ephemeral-storage: "100Gi"
@@ -0,0 +1,23 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: {{ .Release.Name }}-service
5
+ labels:
6
+ app: {{ .Chart.Name }}-head
7
+ spec:
8
+ clusterIP: None
9
+ ports:
10
+ - name: client
11
+ protocol: TCP
12
+ port: 10001
13
+ targetPort: 10001
14
+ - name: dashboard
15
+ protocol: TCP
16
+ port: 8265
17
+ targetPort: 8265
18
+ - name: gcs-server
19
+ protocol: TCP
20
+ port: 6380
21
+ targetPort: 6380
22
+ selector:
23
+ app: {{ .Chart.Name }}-head
@@ -0,0 +1,9 @@
1
+ apiVersion: v1
2
+ kind: Secret
3
+ metadata:
4
+ name: {{ .Release.Name }}-credentials
5
+ type: Opaque
6
+ stringData:
7
+ WANDB_API_KEY: {{ .Values.secret.wandbKey }}
8
+ AWS_ACCESS_KEY_ID: {{ .Values.secret.awsId }}
9
+ AWS_SECRET_ACCESS_KEY: {{ .Values.secret.awsKey }}
@@ -0,0 +1,10 @@
1
+ {{- if .Values.dev }}
2
+ apiVersion: v1
3
+ kind: Secret
4
+ metadata:
5
+ name: {{ .Release.Name }}-git-creds
6
+ type: Opaque
7
+ data:
8
+ ssh: {{ .Values.gitRepo.sshKey | b64enc }}
9
+ known_hosts: {{ .Values.gitRepo.known_hosts | quote | b64enc | indent 2 }}
10
+ {{- end }}
@@ -0,0 +1,109 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: {{ .Release.Name }}-worker
5
+ labels:
6
+ app: {{ .Chart.Name }}-worker
7
+ spec:
8
+ replicas: {{ .Values.worker.replicas }}
9
+ selector:
10
+ matchLabels:
11
+ component: {{ .Chart.Name }}-worker
12
+ type: ray
13
+ app: {{ .Chart.Name }}-worker
14
+ template:
15
+ metadata:
16
+ labels:
17
+ component: {{ .Chart.Name }}-worker
18
+ type: ray
19
+ app: {{ .Chart.Name }}-worker
20
+ spec:
21
+ affinity:
22
+ nodeAffinity:
23
+ requiredDuringSchedulingIgnoredDuringExecution:
24
+ nodeSelectorTerms:
25
+ - matchExpressions:
26
+ - key: nvidia.com/gpu.memory
27
+ operator: Gt
28
+ values:
29
+ - {{ .Values.worker.min_gpu_memory | quote }}
30
+ restartPolicy: Always
31
+ volumes:
32
+ - name: dshm
33
+ emptyDir:
34
+ medium: Memory
35
+ - name: {{ .Values.gitRepo.name }}-volume
36
+ emptyDir: {}
37
+ - name: {{ .Release.Name }}-git-secret
38
+ secret:
39
+ defaultMode: 0400
40
+ secretName: {{ .Release.Name }}-git-creds
41
+ securityContext:
42
+ fsGroup: 65533
43
+ {{- if .Values.dev }}
44
+ initContainers:
45
+ - name: git-sync
46
+ image: registry.k8s.io/git-sync/git-sync:v4.2.1
47
+ env:
48
+ - name: GITSYNC_REPO
49
+ value: {{ .Values.gitRepo.url }}
50
+ - name: GITSYNC_REF
51
+ value: {{ .Values.gitRepo.ref }}
52
+ - name: GITSYNC_ROOT
53
+ value: {{ .Values.gitRepo.mountPath }}
54
+ - name: GITSYNC_LINK
55
+ value: {{ .Values.gitRepo.name }}
56
+ - name: GITSYNC_ONE_TIME
57
+ value: "true"
58
+ - name: GITSYNC_SSH_KNOWN_HOSTS
59
+ value: "false"
60
+ - name: GITSYNC_SUBMODULES
61
+ value: "recursive"
62
+ - name: GITSYNC_ADD_USER
63
+ value: "true"
64
+ - name: GITSYNC_SYNC_TIMEOUT
65
+ value: "360s"
66
+ volumeMounts:
67
+ - name: {{ .Values.gitRepo.name }}-volume
68
+ mountPath: {{ .Values.gitRepo.mountPath }}
69
+ - name: {{ .Release.Name }}-git-secret
70
+ mountPath: /etc/git-secret
71
+ readOnly: true
72
+ securityContext:
73
+ runAsUser: 65533
74
+ {{- end }}
75
+ containers:
76
+ - name: ray-worker
77
+ image: {{ .Values.image }}
78
+ imagePullPolicy: {{ .Values.imagePullPolicy }}
79
+ command: ["/bin/bash", "-c", "--"]
80
+ args:
81
+ - "ray start --num-cpus=$MY_CPU_REQUEST --address={{ .Release.Name }}-service:6380 --object-manager-port=8076 --node-manager-port=8077 --dashboard-agent-grpc-port=8078 --dashboard-agent-listen-port=52365 --block"
82
+ volumeMounts:
83
+ - mountPath: /dev/shm
84
+ name: dshm
85
+ {{- if .Values.dev }}
86
+ - mountPath: {{ .Values.gitRepo.mountPath }}
87
+ name: {{ .Values.gitRepo.name }}-volume
88
+ {{- end }}
89
+ env:
90
+ - name: MY_CPU_REQUEST
91
+ valueFrom:
92
+ resourceFieldRef:
93
+ resource: requests.cpu
94
+ - name: AWS_ENDPOINT_URL
95
+ value: {{ .Values.awsUrl }}
96
+ envFrom:
97
+ - secretRef:
98
+ name: {{ .Release.Name }}-credentials
99
+ resources:
100
+ limits:
101
+ nvidia.com/gpu: {{ .Values.worker.gpu | quote }}
102
+ cpu: {{ .Values.worker.cpu | quote }}
103
+ ephemeral-storage: 110Gi
104
+ memory: {{ .Values.worker.memory | quote }}
105
+ requests:
106
+ nvidia.com/gpu: {{ .Values.worker.gpu | quote }}
107
+ cpu: {{ .Values.worker.cpu | quote }}
108
+ ephemeral-storage: 100Gi
109
+ memory: {{ .Values.worker.memory | quote }}
@@ -0,0 +1,53 @@
1
+ # release name
2
+ name: ray-cluster
3
+ # image for worker and head pods
4
+ image: rayproject/ray:2.3.0
5
+ # whether or not to always pull image from remote repo
6
+ imagePullPolicy: Always
7
+
8
+ # dev specifies if remote code should be mounted
9
+ dev: false
10
+
11
+ # if dev is true, the repository that will be mounted
12
+ gitRepo:
13
+ # git url for repo
14
+ url: git@github.com:ML4GW/aframev2.git
15
+ # location where git-sync will store data
16
+ mountPath: /opt
17
+ # name relative to mountPath where code will be cloned
18
+ # and, identifier for git repo in yaml
19
+ name: aframe
20
+ # branch or commit on git repo
21
+ ref: main
22
+ # ssh key that will be mapped into container for cloning
23
+ sshKey: ""
24
+
25
+ head:
26
+ # number of cpus for the head pod
27
+ cpu: "32"
28
+ # memory for the head pod
29
+ memory: "32G"
30
+
31
+ worker:
32
+ # number of worker pods to create
33
+ replicas: 1
34
+ # number of cpus per work pod
35
+ cpu: "32"
36
+ # memory per worker pod
37
+ memory: "32G"
38
+ # gpus per worker pod
39
+ gpu: "1"
40
+ # minimum amount of gpu memory
41
+ min_gpu_memory: "15000"
42
+
43
+ # url for s3 cluster
44
+ awsUrl: http://rook-ceph-rgw-nautiluss3.rook
45
+
46
+ # secret that will be used with worker pods
47
+ secret:
48
+ # value of WANDB_API_KEY environment variable
49
+ wandbKey: ""
50
+ # value of AWS_ACCESS_KEY_ID environment variable
51
+ awsId: ""
52
+ # value of AWS_SECRET_ACCESS_KEY environment variable
53
+ awsKey: ""
File without changes
@@ -0,0 +1,20 @@
1
+ trainer:
2
+ max_epochs: 100
3
+ logger:
4
+ class_path: lightning.pytorch.loggers.CSVLogger
5
+ init_args:
6
+ save_dir: "logs/"
7
+
8
+ data:
9
+ class_path: example.lightning.SimpleDataModule
10
+ init_args:
11
+ data_dim: 10
12
+ num_samples: 1000
13
+ batch_size: 32
14
+
15
+ model:
16
+ class_path: example.lightning.SimpleModel
17
+ init_args:
18
+ data_dim: 10
19
+ hidden_size: 32
20
+ learning_rate: 0.01
@@ -0,0 +1,54 @@
1
+ # ray.tune.TuneConfig
2
+ tune_config:
3
+ mode: "min"
4
+ metric: "val_loss"
5
+ scheduler:
6
+ class_path: ray.tune.schedulers.ASHAScheduler
7
+ init_args:
8
+ max_t: 200
9
+ grace_period: 21
10
+ reduction_factor: 2
11
+ num_samples: 8
12
+ reuse_actors: true
13
+
14
+ # ray.train.RunConfig
15
+ run_config:
16
+ name: "my-first-run"
17
+ storage_path: s3://aframe-test/new-tune/
18
+ failure_config:
19
+ class_path: ray.train.FailureConfig
20
+ init_args:
21
+ max_failures: 1
22
+ checkpoint_config:
23
+ class_path: ray.train.CheckpointConfig
24
+ init_args:
25
+ num_to_keep: 5
26
+ checkpoint_score_attribute: "val_loss"
27
+ checkpoint_score_order: "min"
28
+ verbose: null
29
+
30
+ # ray.train.SyncConfig
31
+ sync_config:
32
+ sync_period: 1000
33
+
34
+ # ray.init
35
+ ray_init:
36
+ address: null
37
+
38
+ # tune.Tune.param_space
39
+ param_space:
40
+ model.learning_rate: tune.loguniform(1e-3, 4)
41
+
42
+ # ray.tune.TuneCallback
43
+ tune_callback:
44
+ class_path: lightray.callbacks.LightRayReportCheckpointCallback
45
+ init_args:
46
+ 'on': "validation_end"
47
+ checkpoint_every: 10
48
+
49
+ # resources per trial
50
+ cpus_per_trial: 2
51
+ gpus_per_trial: 1
52
+
53
+ # lightning cli cls
54
+ lightning_cli_cls: example.lightning.Cli