File tree Expand file tree Collapse file tree 7 files changed +16
-18
lines changed
ray-operator/config/samples Expand file tree Collapse file tree 7 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 13
13
spec :
14
14
containers :
15
15
- name : ray-head
16
- image : rayproject/ray:2.46.0
16
+ image : rayproject/ray:2.46.0-py310
17
17
imagePullPolicy : IfNotPresent
18
18
resources :
19
19
limits :
57
57
spec :
58
58
containers :
59
59
- name : ray-worker
60
- image : rayproject/ray:2.46.0
60
+ image : rayproject/ray:2.46.0-py310
61
61
imagePullPolicy : IfNotPresent
62
62
resources :
63
63
limits :
Original file line number Diff line number Diff line change 10
10
spec :
11
11
containers :
12
12
- name : ray-head
13
- image : rayproject/ray:2.46.0
13
+ image : rayproject/ray:2.46.0-py310
14
14
imagePullPolicy : IfNotPresent
15
15
resources :
16
16
limits :
41
41
spec :
42
42
containers :
43
43
- name : ray-worker
44
- image : rayproject/ray:2.46.0
44
+ image : rayproject/ray:2.46.0-py310
45
45
imagePullPolicy : IfNotPresent
46
46
resources :
47
47
limits :
Original file line number Diff line number Diff line change 10
10
spec :
11
11
containers :
12
12
- name : ray-head
13
- image : rayproject/ray:2.46.0
13
+ image : rayproject/ray:2.46.0-py310
14
14
imagePullPolicy : IfNotPresent
15
15
resources :
16
16
limits :
41
41
spec :
42
42
containers :
43
43
- name : ray-worker
44
- image : rayproject/ray:2.46.0
44
+ image : rayproject/ray:2.46.0-py310
45
45
imagePullPolicy : IfNotPresent
46
46
resources :
47
47
limits :
Original file line number Diff line number Diff line change 7
7
runtimeEnvYAML : |
8
8
working_dir: "https://github.com/ray-project/kuberay/archive/master.zip"
9
9
pip:
10
- - jax[tpu]==0.4.33
10
+ - jax[tpu]==0.6.1
11
11
- -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
12
12
rayClusterSpec :
13
13
rayVersion : ' 2.46.0'
17
17
spec :
18
18
containers :
19
19
- name : ray-head
20
- image : rayproject/ray:2.46.0
20
+ image : rayproject/ray:2.46.0-py310
21
21
ports :
22
22
- containerPort : 6379
23
23
name : gcs-server
47
47
runAsUser : 0
48
48
containers :
49
49
- name : ray-worker
50
- image : rayproject/ray:2.46.0
50
+ image : rayproject/ray:2.46.0-py310
51
51
resources :
52
52
limits :
53
53
cpu : " 24"
Original file line number Diff line number Diff line change 17
17
spec :
18
18
containers :
19
19
- name : ray-head
20
- image : rayproject/ray:2.46.0
20
+ image : rayproject/ray:2.46.0-py310
21
21
ports :
22
22
- containerPort : 6379
23
23
name : gcs-server
46
46
spec :
47
47
containers :
48
48
- name : ray-worker
49
- image : rayproject/ray:2.46.0
49
+ image : rayproject/ray:2.46.0-py310
50
50
resources :
51
51
limits :
52
52
cpu : " 24"
Original file line number Diff line number Diff line change 7
7
runtimeEnvYAML : |
8
8
working_dir: "https://github.com/ray-project/kuberay/archive/master.zip"
9
9
pip:
10
- - jax[tpu]==0.4.33
10
+ - jax[tpu]==0.6.1
11
11
- -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
12
12
rayClusterSpec :
13
13
rayVersion : ' 2.46.0'
17
17
spec :
18
18
containers :
19
19
- name : ray-head
20
- image : rayproject/ray:2.46.0
20
+ image : rayproject/ray:2.46.0-py310
21
21
ports :
22
22
- containerPort : 6379
23
23
name : gcs-server
45
45
runAsUser : 0
46
46
containers :
47
47
- name : ray-worker
48
- image : rayproject/ray:2.46.0
48
+ image : rayproject/ray:2.46.0-py310
49
49
resources :
50
50
limits :
51
51
cpu : " 24"
Original file line number Diff line number Diff line change 1
1
import os
2
2
import ray
3
3
import jax
4
- import time
5
4
6
5
from jax .experimental import multihost_utils
7
6
10
9
@ray .remote (resources = {"TPU" : 4 })
11
10
def tpu_cores ():
12
11
multihost_utils .sync_global_devices ("sync" )
13
- cores = "TPU cores:" + str (jax .device_count ())
14
- print ("TPU Worker: " + os .environ .get ("TPU_WORKER_ID" ))
15
- return cores
12
+ print (f"TPU Worker: { os .environ .get ('TPU_WORKER_ID' )} " )
13
+ return f"TPU cores: { jax .device_count ()} "
16
14
17
15
num_workers = int (ray .available_resources ()["TPU" ]) // 4
18
16
print (f"Number of TPU Workers: { num_workers } " )
You can’t perform that action at this time.
0 commit comments