[docker] Detect CPUs in container correctly (#10507)

Co-authored-by: simon-mo <simon.mo@hey.com>
Co-authored-by: Richard Liaw <rliaw@berkeley.edu>
Co-authored-by: Alex Wu <itswu.alex@gmail.com>
This commit is contained in:
Ian Rodney
2020-09-13 23:40:48 -07:00
committed by GitHub
co-authored by simon-mo Richard Liaw Alex Wu
parent 660aee6311
commit 5bc2ba38fd
35 changed files with 173 additions and 45 deletions
+2
View File
@@ -50,11 +50,13 @@ Serve a function by defining a function, an endpoint, and a backend (in this cas
connecting the two by setting traffic from the endpoint to the backend.
.. literalinclude:: ../../../python/ray/serve/examples/doc/quickstart_function.py
:lines: 2-4,6-7,9-
Serve a stateful class by defining a class (``Counter``), creating an endpoint and a backend, then connecting
the two by setting traffic from the endpoint to the backend.
.. literalinclude:: ../../../python/ray/serve/examples/doc/quickstart_class.py
:lines: 2-4,6-7,9-
See :doc:`key-concepts` for more exhaustive coverage about Ray Serve and its core concepts.
@@ -97,6 +97,7 @@ import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import ray
from ray import tune, serve
from ray.serve.exceptions import RayServeException
from ray.tune import CLIReporter
@@ -613,6 +614,9 @@ if __name__ == "__main__":
args = parser.parse_args()
if args.smoke_test:
ray.init(num_cpus=2)
model_dir = os.path.expanduser(args.model_dir)
if args.query >= 0: