Skip to content

Commit

Permalink
Merge branch 'master' into ISSUE-24869
Browse files Browse the repository at this point in the history
* master: (35 commits)
  [tune/structure] Refactor `suggest` into `search` package (ray-project#26074)
  Add back ray.state in deprecation wrapper; print stack trace on warning (ray-project#26086)
  Enable isort for base directory (ray-project#26085)
  [AIR] Add __init__.py to ray.air.callbacks (ray-project#26088)
  [Serve] [Docs] Create end-to-end documentation example for Serve REST API and CLI (ray-project#25936)
  [AIR] Remove unnecessary pandas from examples (ray-project#26009)
  [Datasets] [Hotfix] Update `ds.to_pandas()` limit error to reflect current limit API (ray-project#26081)
  [Serve] [Docs] Add Serve REST API Schema to Serve API Docs (ray-project#25786)
  [Core][Doc] remove cython section from advanced doc. ray-project#26062
  [Core] Fix check failure from incorrect death cause (ray-project#26007)
  [hotfix] Fix linkcheck (ray-project#26070)
  [RLlib] Add timeout to filter synchronization. (ray-project#25959)
  [tune/structure] Introduce logger package (ray-project#26049)
  [RLlib] introduce serialization for our custom gym space types. (ray-project#25923)
  Fix unit test test_check_env.py and est_check_multi_agent.py. (ray-project#25993)
  [RLlib] Make QMix use the ReplayBufferAPI (ray-project#25560)
  [CI] deflake test_multi_node_3 by increasing its timeout
  [CI] Use BUILDKITE_JOB_ID for better navigation for flaky tracker (ray-project#26021)
  [AIR/Docs] Improve user guide gallery (ray-project#26016)
  🎨 Update type annotations to include options in `ray.remote()` (ray-project#25999)
  ...
  • Loading branch information
Your Name committed Jun 30, 2022
2 parents 2882d36 + 75d08b0 commit 5e4fff9
Show file tree
Hide file tree
Showing 320 changed files with 19,753 additions and 16,611 deletions.
6 changes: 3 additions & 3 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ float_to_top=True
filter_files=True

# Skip docs/* as these are carefully crafted and aren't strictly code.
# Skip python/ray/*.py to avoid touching python/ray/__init__.py, which
# is also carefully crafted.
# Skip python/ray/__init__.py and python/ray/setup-dev.py, which
# are also carefully crafted.
# For the rest we will gradually remove them from the blacklist as we
# reformat the code to follow the style guide.
skip_glob=python/ray/*.py,doc/*,ci/*,python/ray/_raylet*,python/ray/_private/*,python/ray/air/*,python/ray/cloudpickle/*,python/ray/core/*,dashboard/*,python/ray/data/*,python/ray/experimental/*,python/ray/includes/*,python/ray/internal/*,python/ray/ray_operator/*,python/ray/scripts/*,python/ray/serve/*,python/ray/sgd/*,python/ray/streaming/*,python/ray/tests/*,python/ray/tests/*,python/ray/train/*,python/ray/tune/*,python/ray/util/*,python/ray/workers/*,python/ray/workflow/*,rllib/*,release/*,
skip_glob=python/ray/__init__.py,python/ray/setup-dev.py,python/ray/dag/*.py,doc/*,ci/*,python/ray/_raylet*,python/ray/_private/*,python/ray/air/*,python/ray/cloudpickle/*,python/ray/core/*,dashboard/*,python/ray/data/*,python/ray/experimental/*,python/ray/includes/*,python/ray/internal/*,python/ray/ray_operator/*,python/ray/scripts/*,python/ray/serve/*,python/ray/sgd/*,python/ray/streaming/*,python/ray/tests/*,python/ray/tests/*,python/ray/train/*,python/ray/tune/*,python/ray/util/*,python/ray/workers/*,python/ray/workflow/*,rllib/*,release/*,

known_local_folder=ray
known_afterray=psutil,setproctitle
Expand Down
4 changes: 1 addition & 3 deletions ci/build/get_build_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ def get_build_env():
return {
"TRAVIS_COMMIT": os.environ["BUILDKITE_COMMIT"],
"TRAVIS_JOB_WEB_URL": (
os.environ["BUILDKITE_BUILD_URL"]
+ "#"
+ os.environ["BUILDKITE_BUILD_ID"]
os.environ["BUILDKITE_BUILD_URL"] + "#" + os.environ["BUILDKITE_JOB_ID"]
),
"TRAVIS_OS_NAME": { # The map is used to stay consistent with Travis
"linux": "linux",
Expand Down
4 changes: 2 additions & 2 deletions ci/repro-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def aws_start_instance(self):
# Check if instance exists:
running_instances = self.ec2_resource.instances.filter(
Filters=[
{"Name": "tag:repro_name", "Values": [self.aws_instance_name]},
{"Name": "tag:Name", "Values": [self.aws_instance_name]},
{"Name": "instance-state-name", "Values": ["running"]},
]
)
Expand Down Expand Up @@ -218,7 +218,7 @@ def aws_start_instance(self):
TagSpecifications=[
{
"ResourceType": "instance",
"Tags": [{"Key": "repro_name", "Value": self.aws_instance_name}],
"Tags": [{"Key": "Name", "Value": self.aws_instance_name}],
}
],
MinCount=1,
Expand Down
1 change: 1 addition & 0 deletions doc/source/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ parts:
- file: serve/deployment-graph/control_flow_based_on_user_inputs
- file: serve/deployment-graph/visualize_dag_during_development
- file: serve/deployment-graph/http_endpoint_for_dag_graph
- file: serve/production
- file: serve/architecture
- file: serve/tutorials/index
- file: serve/faq
Expand Down
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
r"https://huggingface.co/*", # seems to be flaky
r"https://www.meetup.com/*", # seems to be flaky
r"https://www.pettingzoo.ml/*", # seems to be flaky
r"http://localhost[:/].*", # Ignore localhost links
]

# -- Options for HTML output ----------------------------------------------
Expand Down
6 changes: 1 addition & 5 deletions doc/source/ray-air/doc_code/air_key_concepts.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,7 @@
batch_predictor = BatchPredictor.from_checkpoint(result.checkpoint, XGBoostPredictor)

# Bulk batch prediction.
predicted_labels = (
batch_predictor.predict(test_dataset)
.map_batches(lambda df: (df > 0.5).astype(int), batch_format="pandas")
.to_pandas(limit=float("inf"))
)
predicted_probabilities = batch_predictor.predict(test_dataset)

# Pipelined batch prediction: instead of processing the data in bulk, process it
# incrementally in windows of the given size.
Expand Down
24 changes: 11 additions & 13 deletions doc/source/ray-air/doc_code/preprocessors.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,19 +88,17 @@
test_dataset = ray.data.from_items([{"x": x} for x in range(2, 32, 3)])

batch_predictor = BatchPredictor.from_checkpoint(checkpoint, XGBoostPredictor)
predicted_labels = batch_predictor.predict(test_dataset)
print(predicted_labels.to_pandas())
# predictions
# 0 0.098437
# 1 5.604667
# 2 11.405312
# 3 15.684700
# 4 23.990948
# 5 29.900211
# 6 34.599442
# 7 40.696899
# 8 45.681076
# 9 50.290031
predicted_probabilities = batch_predictor.predict(test_dataset)
predicted_probabilities.show()
# {'predictions': 0.09843720495700836}
# {'predictions': 5.604666709899902}
# {'predictions': 11.405311584472656}
# {'predictions': 15.684700012207031}
# {'predictions': 23.990947723388672}
# {'predictions': 29.900211334228516}
# {'predictions': 34.59944152832031}
# {'predictions': 40.6968994140625}
# {'predictions': 45.68107604980469}
# __predictor_end__


Expand Down
4 changes: 2 additions & 2 deletions doc/source/ray-air/doc_code/tf_starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def train_func(config: dict):

predictions = batch_predictor.predict(prediction_dataset, dtype=tf.float32)

pandas_predictions = predictions.to_pandas(float("inf"))
print("PREDICTIONS")
predictions.show()

print(f"PREDICTIONS\n{pandas_predictions}")
# __air_tf_batchpred_end__
16 changes: 5 additions & 11 deletions doc/source/ray-air/doc_code/xgboost_starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,11 @@

batch_predictor = BatchPredictor.from_checkpoint(result.checkpoint, XGBoostPredictor)

predicted_labels = (
batch_predictor.predict(test_dataset)
.map_batches(lambda df: (df > 0.5).astype(int), batch_format="pandas")
.to_pandas(limit=float("inf"))
)
print("PREDICTED LABELS")
print(f"{predicted_labels}")
predicted_probabilities = batch_predictor.predict(test_dataset)
print("PREDICTED PROBABILITIES")
predicted_probabilities.show()

shap_values = batch_predictor.predict(test_dataset, pred_contribs=True).to_pandas(
limit=float("inf")
)
shap_values = batch_predictor.predict(test_dataset, pred_contribs=True)
print("SHAP VALUES")
print(f"{shap_values}")
shap_values.show()
# __air_xgb_batchpred_end__
Loading

0 comments on commit 5e4fff9

Please sign in to comment.