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

[Misc] Consolidate app and simulator #477

Merged
merged 3 commits into from
Dec 4, 2024

Conversation

zhangjyr
Copy link
Collaborator

@zhangjyr zhangjyr commented Dec 4, 2024

Pull Request Description

We previously built a CPU-mocked app to facilitate fast prototyping and local development. This approach was convenient as it eliminated the need for GPU resources and simulated OpenAI-like interfaces and metrics effectively.

Recently, #430 introduced a separate app for simulation purposes. While it adds value, having separate apps for similar functionalities increases complexity and maintenance overhead.

This PR consolidates the simulator to the previous mock app. Since the simulator is GPU-specific, a separate base image is needed for the simulator of various GPUs. Currently, the default GPU is a100. Examples of config other GPUs are included.

Related Issues

Resolves: #456

Important: Before submitting, please complete the description above and review the checklist below.


Contribution Guidelines (Expand for Details)

We appreciate your contribution to aibrix! To ensure a smooth review process and maintain high code quality, please adhere to the following guidelines:

Pull Request Title Format

Your PR title should start with one of these prefixes to indicate the nature of the change:

  • [Bug]: Corrections to existing functionality
  • [CI]: Changes to build process or CI pipeline
  • [Docs]: Updates or additions to documentation
  • [API]: Modifications to aibrix's API or interface
  • [CLI]: Changes or additions to the Command Line Interface
  • [Misc]: For changes not covered above (use sparingly)

Note: For changes spanning multiple categories, use multiple prefixes in order of importance.

Submission Checklist

  • PR title includes appropriate prefix(es)
  • Changes are clearly explained in the PR description
  • New and existing tests pass successfully
  • Code adheres to project style and best practices
  • Documentation updated to reflect changes (if applicable)
  • Thorough testing completed, no regressions introduced

By submitting this PR, you confirm that you've read these guidelines and your changes align with the project's contribution standards.

@zhangjyr zhangjyr added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. area/heterogeneous labels Dec 4, 2024
@zhangjyr zhangjyr added this to the v0.2.0 milestone Dec 4, 2024
@zhangjyr zhangjyr requested review from Jeffwan and nwangfw December 4, 2024 01:03
Copy link
Collaborator

@Jeffwan Jeffwan left a comment

Choose a reason for hiding this comment

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

overall looks good to me

COPY ./*.py /app/

ENV MODEL_NAME=llama2-7b
ARG GPU_TYPE=disabled
Copy link
Collaborator

Choose a reason for hiding this comment

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

minor: I'd rather to have two args, profiler enabled/disabled and gpu type.
if profile == enabled, gpu_types should exist.

This makes the code more readable for people who is not familiar with this feature

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can add another bool switch here. Although the profiling necessity is the reason for separate images, this switch will also enable/disable the simulation feature. So, I will name the switch as "simulation."

Copy link
Collaborator Author

@zhangjyr zhangjyr Dec 4, 2024

Choose a reason for hiding this comment

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

Things get a little complicated as:

  1. The vidur argparse overrides mock app argument parsing. So, no new argument can be added with the current implementation. This means even if I added a new ARG for Dockerfile, the mock app will still use one argument.
  2. The Dockerfile does not have complex condition logic. I currently use ENV to pass ARG to CMD; the difference between Dockerfile BUILD-ARGs and mock app arguments will be error-prone.

Copy link
Collaborator

Choose a reason for hiding this comment

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

then let's stick to one argument at this moment and rename to simulation, that looks good to me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

@nwangfw
Copy link
Collaborator

nwangfw commented Dec 4, 2024

Looks good to me.

Change build arg from GPU_TYPE to SIMULATION
@Jeffwan
Copy link
Collaborator

Jeffwan commented Dec 4, 2024

Seem all reviewers left feedbacks and all of them have been addressed, we can merge this change.

@Jeffwan Jeffwan merged commit 54a88cb into main Dec 4, 2024
2 checks passed
@Jeffwan Jeffwan deleted the issues/456_Consolidate_app_and_simulator branch December 4, 2024 20:03
gangmuk pushed a commit that referenced this pull request Jan 25, 2025
* Merge simulator to app

* Fix namespace.

* Using model tokenizer if possible. Token is needed for gated model.
Change build arg from GPU_TYPE to SIMULATION

---------

Co-authored-by: Jingyuan Zhang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/heterogeneous kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consolidate mocked app and simulator into one unified mock app for development
3 participants