Skip to content

Commit

Permalink
Merge branch 'master' into restored_iceberg
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-goyal authored Aug 15, 2024
2 parents 2342d18 + 3351a46 commit acf2c2b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/source/_static/img/run-quickstart-anyscale.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"source": [
"# Image Classification Batch Inference with PyTorch\n",
"\n",
"[![try-anyscale-quickstart-image-classification-batch-inference-with-pytorch](../../_static/img/run-quickstart-anyscale.svg)](https://console.anyscale.com/v2/template-preview/ray-data-batch-image-classification?utm_source=ray_docs&utm_medium=docs&utm_campaign=image-classification-batch-inference-with-pytorch)\n",
"\n",
"In this example, we will introduce how to use [Ray Data](data) for **large-scale batch inference with multiple GPU workers.**\n",
"\n",
"In particular, we will:\n",
Expand Down
2 changes: 1 addition & 1 deletion python/ray/data/_internal/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(
computation and avoiding actor startup delays, but will also increase
queueing delay.
"""
if size:
if size is not None:
if size < 1:
raise ValueError("size must be >= 1", size)
if max_size is not None or min_size is not None:
Expand Down
2 changes: 2 additions & 0 deletions src/ray/core_worker/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ void WorkerContext::SetCurrentTask(const TaskSpecification &task_spec) {

void WorkerContext::ResetCurrentTask() { GetThreadContext().ResetCurrentTask(); }

/// NOTE: This method can't be used in fiber/async actor context.
std::shared_ptr<const TaskSpecification> WorkerContext::GetCurrentTask() const {
return GetThreadContext().GetCurrentTask();
}
Expand Down Expand Up @@ -416,6 +417,7 @@ const ObjectID WorkerContext::GetGeneratorReturnId(
return ObjectID::FromIndex(current_task_id, current_put_index);
}

/// NOTE: This method can't be used in fiber/async actor context.
WorkerThreadContext &WorkerContext::GetThreadContext() const {
if (thread_context_ == nullptr) {
absl::ReaderMutexLock lock(&mutex_);
Expand Down
2 changes: 2 additions & 0 deletions src/ray/core_worker/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class WorkerContext {

void ResetCurrentTask();

/// NOTE: This method can't be used in fiber/async actor context.
std::shared_ptr<const TaskSpecification> GetCurrentTask() const;

const ActorID &GetCurrentActorID() const ABSL_LOCKS_EXCLUDED(mutex_);
Expand Down Expand Up @@ -165,6 +166,7 @@ class WorkerContext {
mutable absl::Mutex mutex_;

private:
/// NOTE: This method can't be used in fiber/async actor context.
WorkerThreadContext &GetThreadContext() const;

/// Per-thread worker context.
Expand Down

0 comments on commit acf2c2b

Please sign in to comment.