Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(shortfin-sd) Program initialization and logging improvements #444

Merged
merged 12 commits into from
Nov 9, 2024

Conversation

monorimet
Copy link
Contributor

No description provided.

@monorimet monorimet marked this pull request as draft November 7, 2024 05:29
@monorimet
Copy link
Contributor Author

Best found throughput number (11/6) is at .89 samples per second per gpu. More progress to come.

@monorimet
Copy link
Contributor Author

monorimet commented Nov 7, 2024

New best:

THROUGHPUT: 0.9889117096311715 samples per second

Repro:

SHORTFIN_AMDGPU_LOGICAL_DEVICES_PER_PHYSICAL_DEVICE=4 ROCR_VISIBLE_DEVICES=7 SHORTFIN_ALLOCATORS=caching python -m shortfin_apps.sd.server --model_config=./python/shortfin_apps/sd/examples/sdxl_config_i8.json --device=amdgpu --fibers_per_device=8 --workers_per_device=8 --isolation="none" --flagfile=./python/shortfin_apps/sd/examples/sdxl_flags_gfx942.txt --build_preference=compile

in another shell:

python ./python/shortfin_apps/sd/examples/send_request.json --file=./python/shortfin_apps/sd/examples/sdxl_request_bs32.json

Copy link
Contributor

@stellaraccident stellaraccident left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits.

@@ -196,7 +197,8 @@ def configure_mode(env_info: EnvInfo, args):
env_vars["SHORTFIN_IREE_SOURCE_DIR"] = env_info.iree_dir
if env_info.clang_exe:
env_vars["CC"] = env_info.clang_exe
env_vars["CXX"] = f"{env_info.clang_exe}++"
clangxx_exe = "clang++-".join(env_info.clang_exe.split("clang-"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work for unadorned "clang" commands? Maybe drop this file from the patch and we do it separately?

@@ -34,7 +34,7 @@ def __init__(self, device="local-task", device_ids=None):
raise ValueError(f"Device id {did} could not be parsed.")
else:
selected = available
sb = sf.amdgpu.SystemBuilder(amdgpu_visible_devices=";".join(selected))
sb = sf.SystemBuilder(system_type="amdgpu")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just create the SystemBuilder once:

sb = sf.SystemBuilder(system_type="amdgpu")
sb.visible_devices = get_selected_devices(sb)
self.ls = sb.create_system()

(i.e. you can set properties between construction of the SystemBuilder and create_system())

Note that the property takes a normal list of strings so no need to join.

It also looks like you dropped the visible_devices thing in this patch.

Copy link
Contributor Author

@monorimet monorimet Nov 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that makes more sense. thanks.

@@ -23,6 +23,7 @@ AMDGPUSystemBuilder::AMDGPUSystemBuilder(iree_allocator_t host_allocator,
iree_hal_hip_device_params_initialize(&default_device_params_);
InitializeDefaultSettings();
config_options().ValidateUndef();
default_device_params_.async_allocations = false;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can drop this now.

@monorimet monorimet changed the title (WIP) SDXL Throughput improvements (shortfin-sd) Program initialization and logging improvements Nov 8, 2024
@monorimet monorimet marked this pull request as ready for review November 9, 2024 17:00
@monorimet monorimet merged commit 029d35e into main Nov 9, 2024
11 of 12 checks passed
@monorimet monorimet deleted the sdxl-multi-program-init branch November 9, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants