Skip to content
Open
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9d3e8d1
move content into content/
Nov 12, 2025
cd90a58
make release test ci/ folder
Nov 12, 2025
5c4e5ce
make template workspace configs/ (compute config)
Nov 12, 2025
4a11152
adding release tests
Nov 12, 2025
ef2c09f
remove README from sphinx discovery
Nov 12, 2025
21d6470
move order in examples.yml
Nov 12, 2025
f67cab0
add vocabulary for vale compliance
Nov 12, 2025
8f76af4
(ci test only) limit size of large dataset to 10k samples instead of …
Nov 12, 2025
7be6989
fix link to notebook in examples.yml
Nov 13, 2025
16a4d35
fix prompt
Nov 13, 2025
ff185f0
adding to examples.yml
Nov 13, 2025
d333e83
adding release test config
Nov 13, 2025
b6d758c
update content with new dataset
Nov 13, 2025
1466052
add byod for release test
Nov 13, 2025
11486df
nitpick template vision text
Nov 13, 2025
62b50b2
adding llm batch inference vision workspace
Nov 13, 2025
1e4450b
refactor content for consistency
Nov 13, 2025
31b0634
fix worker node gce
Nov 14, 2025
f5d2b61
reformat
Nov 14, 2025
15e01ce
vale
Nov 14, 2025
cfb1979
sphinx orphan for notebook
Nov 14, 2025
858144c
update image
Nov 14, 2025
94006d7
adding batch inference llm visio nhelper modules
Nov 14, 2025
345483b
reformat nitpicks
Nov 14, 2025
611a7b6
fix issues cursor
Nov 14, 2025
92243df
fix job config
Nov 14, 2025
06f24e6
fix job config for vision tempalte
Nov 14, 2025
271f2c9
add datasets to byod
Nov 14, 2025
7575da0
ignore % command cell in ci testing
Nov 14, 2025
4224abe
change compute ocnfigs to L4 instead of L40S
Nov 14, 2025
fd4beb5
min_node 0 now
Nov 17, 2025
6fa6bb8
refactor nitpicks
Nov 17, 2025
4d42086
no engine parameters anymore + add stats() tips
Nov 17, 2025
a908ea3
rename variables for scaling section
Nov 17, 2025
0b6e54c
refactor +rebuild helper modules
Nov 17, 2025
b30a21f
Merge branch 'master' into docs/data/examples/llm_batch_inference_small
Aydin-ab Nov 17, 2025
51d9054
remove saving dataset section (buggy)
Nov 17, 2025
b9e5369
fix typoi
Nov 17, 2025
db15a49
fix typoi
Nov 17, 2025
863cfa8
sync with notebook
Nov 17, 2025
8057e69
suggestions applied
Nov 19, 2025
666f623
increase header leavel of performance tips
Nov 24, 2025
ca16504
ref to anyscale docs
Nov 24, 2025
cab65e3
add model parallelism sectioon
Nov 24, 2025
f50dcd8
add markdwon note about repartition()
Nov 24, 2025
44ad061
ci test on small datset instead of 1M rows
Nov 24, 2025
fbbc96c
add helper conversion script + small nitpicks
Nov 26, 2025
cc978e6
apply kunling suggestions
Nov 26, 2025
42891fd
Apply suggestions from code review
Aydin-ab Dec 8, 2025
44c0188
Merge branch 'master' into docs/data/examples/llm_batch_inference_small
Aydin-ab Jan 6, 2026
4d1f6c9
refactor/rename for easier maintainability
Jan 6, 2026
c97621f
follow git bots suggestions
Jan 6, 2026
b3b8d3d
minor gramatical fix
Jan 6, 2026
e3a2445
apply suggestions: fix detokenize issue, typos, thorough explanation …
Jan 8, 2026
6ffeb78
change prompt task to something more relevant to LLM capabilities
Jan 8, 2026
4448896
fix typos, fix error in nb2py and update byod
Jan 8, 2026
41de5fa
add parameter to change dataset size
Jan 8, 2026
cca6c0a
fix vale errors
Jan 8, 2026
9dbe446
fix typo bug + add structured output to text task
Jan 8, 2026
6289489
fix typo
Jan 8, 2026
d109d61
fix structured output bug
Jan 9, 2026
22d189e
remove mention of notebook
Jan 9, 2026
4982f68
reorder examples with more consistent naming/titles
Jan 9, 2026
55d6667
consistent .py script + add informative comments about structured output
Jan 9, 2026
0f64701
fix header typo
Jan 9, 2026
9f126ca
remove detokenize=
Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vale/styles/config/vocabularies/Data/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ PDFs
Predibase('s)?
[Pp]refetch
[Pp]refetching
[Pp]ostprocess
[Pp]ostprocessor(s)?
[Pp]reprocess
[Pp]reprocessor(s)?
process_file
[Pp]ushdown
[Rr]eformat(s)?
queryable
RGB
runai
Expand Down
19 changes: 18 additions & 1 deletion doc/source/data/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,23 @@ examples:
frameworks:
- xgboost
link: ../train/examples/xgboost/distributed-xgboost-lightgbm
- title: LLM Batch Inference for text data
skill_level: beginner
frameworks:
- vLLM
use_cases:
- large language models
- generative ai
link: examples/llm_batch_inference_text/content/README
- title: Vision-language model batch inference with Ray Data
skill_level: beginner
frameworks:
- vLLM
use_cases:
- large language models
- generative ai
- computer vision
link: examples/llm_batch_inference_vision/content/README
- title: Unstructured Data Ingestion and Processing
skill_level: intermediate
frameworks:
Expand All @@ -53,4 +70,4 @@ examples:
use_cases:
- document processing
- data ingestion
link: examples/unstructured_data_ingestion/content/unstructured_data_ingestion
link: examples/unstructured_data_ingestion/content/unstructured_data_ingestion
2 changes: 1 addition & 1 deletion doc/source/data/examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ filegroup(
"**/ci/gce.yaml"
]),
visibility = ["//release:__pkg__"],
)
)
17 changes: 17 additions & 0 deletions doc/source/data/examples/llm_batch_inference_text/ci/aws.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cloud_id: {{env["ANYSCALE_CLOUD_ID"]}}
region: us-west-2

# Head node
head_node_type:
name: 8CPU-32GB
instance_type: m5.2xlarge

# Worker nodes
worker_node_types:
- name: 1xL4:8CPU-32GB
instance_type: g6.2xlarge
min_workers: 0
max_workers: 10

flags:
allow-cross-zone-autoscaling: true
17 changes: 17 additions & 0 deletions doc/source/data/examples/llm_batch_inference_text/ci/gce.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
cloud_id: {{env["ANYSCALE_CLOUD_ID"]}}
region: us-central1

# Head node
head_node_type:
name: 8CPU-32GB
instance_type: n2-standard-8

# Worker nodes
worker_node_types:
- name: 1xL4:8CPU-32GB
instance_type: g2-standard-8-nvidia-l4-1
min_workers: 0
max_workers: 10

flags:
allow-cross-zone-autoscaling: true
78 changes: 78 additions & 0 deletions doc/source/data/examples/llm_batch_inference_text/ci/nb2py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#!/usr/bin/env python3
import argparse
import nbformat


def convert_notebook(
input_path: str, output_path: str, ignore_cmds: bool = False
) -> None:
"""
Read a Jupyter notebook and write a Python script, converting all %%bash
cells and IPython "!" commands into subprocess.run calls that raise on error.
Cells that load or autoreload extensions are ignored.
"""
nb = nbformat.read(input_path, as_version=4)
with open(output_path, "w") as out:
for cell in nb.cells:
# Only process code cells
if cell.cell_type != "code":
continue

lines = cell.source.splitlines()

# Detect a %%bash cell
if lines:
# Detect any IPython '!' shell commands in code lines
has_bang = any(line.lstrip().startswith("!") for line in lines)
# Start with "serve run" "serve shutdown" "curl" or "anyscale service" commands
to_ignore_cmd = (
"serve run",
"serve shutdown",
"curl",
"anyscale service",
)
has_ignored_start = any(
line.lstrip().startswith(to_ignore_cmd) for line in lines
)
if has_bang or has_ignored_start:
if ignore_cmds:
continue
out.write("import subprocess\n")
for line in lines:
stripped = line.lstrip()
if stripped.startswith("!"):
cmd = stripped[1:].lstrip()
out.write(
f"subprocess.run(r'''{cmd}''',\n"
" shell=True,\n"
" check=True,\n"
" executable='/bin/bash')\n"
)
else:
out.write(line.rstrip() + "\n")
out.write("\n")
else:
# Regular Python cell:
code = cell.source.rstrip()
if "ds_large = ds.limit(1_000_000)" in code:
# Instead of testing a large dataset in CI, test a small dataset
code = code.replace("ds.limit(1_000_000)", "ds.limit(10_000)")
# else, dump as-is
out.write(code + "\n\n")


def main() -> None:
parser = argparse.ArgumentParser(
description="Convert a Jupyter notebook to a Python script, preserving bash cells and '!' commands as subprocess calls unless ignored with --ignore-cmds."
)
parser.add_argument("input_nb", help="Path to the input .ipynb file")
parser.add_argument("output_py", help="Path for the output .py script")
parser.add_argument(
"--ignore-cmds", action="store_true", help="Ignore bash cells and '!' commands"
)
args = parser.parse_args()
convert_notebook(args.input_nb, args.output_py, ignore_cmds=args.ignore_cmds)


if __name__ == "__main__":
main()
14 changes: 14 additions & 0 deletions doc/source/data/examples/llm_batch_inference_text/ci/tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Install requirements first (done by CI automatically):
# release/ray_release/byod/byod_llm_batch_inference_text.sh

# Don't use nbconvert or jupytext unless you're willing
# to check each subprocess unit and validate that errors
# aren't being consumed/hidden

set -exo pipefail

python ci/nb2py.py "content/README.ipynb" "content/README.py" --ignore-cmds
python "content/README.py"
rm "content/README.py"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Head node
head_node_type:
name: 8CPU-32GB
instance_type: m5.2xlarge

# Worker nodes
worker_node_types:
- name: 1xL4:8CPU-32GB
instance_type: g6.2xlarge
min_workers: 0
max_workers: 10

flags:
allow-cross-zone-autoscaling: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Head node
head_node_type:
name: 8CPU-32GB
instance_type: n2-standard-8

# Worker nodes
worker_node_types:
- name: 1xL4:8CPU-32GB
instance_type: g2-standard-8-nvidia-l4-1
min_workers: 0
max_workers: 10

flags:
allow-cross-zone-autoscaling: true
Loading