Skip to content

Conversation

@varun-sundar-rabindranath
Copy link
Contributor

@varun-sundar-rabindranath varun-sundar-rabindranath commented Jul 24, 2024

Add Fused Layernorm + Dynamic-Per-Token Quant kernels.

Numbers:
Take away: The fused kernels out perform the unfused counterparts. It is important to note that we don't yet know how much performance gain is actually coming from the fusion (the fused kernels have vectorization optimizations that are not necessarily in their unfused counterparts).

GPU : A6000 x 1
Command: python3 benchmarks/fused_kernels/layernorm_rms_benchmarks.py

<style type="text/css"></style>

num-tokens x hidden-size x add-residual x input-dtype unfused_int8_impl (us) unfused_fp8_impl (us) fused_int8_impl (us) fused_fp8_impl (us)
N 1 x D 1024 x R True x DT torch.bfloat16 22.1 25.4 17.3 17.3
N 1 x D 1024 x R True x DT torch.float32 22.5 25.5 17 16.7
N 1 x D 1024 x R False x DT torch.bfloat16 25 28 16.8 16.9
N 1 x D 1024 x R False x DT torch.float32 24.8 27.8 17.1 17.1
N 1 x D 2048 x R True x DT torch.bfloat16 22.5 25.6 17.1 17.4
N 1 x D 2048 x R True x DT torch.float32 22.5 25.6 17.1 17.2
N 1 x D 2048 x R False x DT torch.bfloat16 24.7 27.8 17.2 17
N 1 x D 2048 x R False x DT torch.float32 25.1 28 16.8 16.9
N 1 x D 3072 x R True x DT torch.bfloat16 22.4 25.4 17.2 17.3
N 1 x D 3072 x R True x DT torch.float32 22.3 25.5 16.9 17.2
N 1 x D 3072 x R False x DT torch.bfloat16 25 27.9 17 17.2
N 1 x D 3072 x R False x DT torch.float32 25.1 27.9 17 17
N 1 x D 4096 x R True x DT torch.bfloat16 22.5 25.5 17 17.4
N 1 x D 4096 x R True x DT torch.float32 22.4 25.7 17.3 17.3
N 1 x D 4096 x R False x DT torch.bfloat16 25.2 28.1 16.9 17.1
N 1 x D 4096 x R False x DT torch.float32 24.9 28.2 17 17.2
N 1 x D 5120 x R True x DT torch.bfloat16 22.5 25.5 17.3 17.4
N 1 x D 5120 x R True x DT torch.float32 22.5 25.6 17.2 17.1
N 1 x D 5120 x R False x DT torch.bfloat16 25 28.1 17.3 17.3
N 1 x D 5120 x R False x DT torch.float32 25.2 28.2 17.2 17.4
N 1 x D 6144 x R True x DT torch.bfloat16 22.4 25.7 17.4 17.3
N 1 x D 6144 x R True x DT torch.float32 22.7 25.8 17.2 17.3
N 1 x D 6144 x R False x DT torch.bfloat16 25.3 28.1 17.1 17.4
N 1 x D 6144 x R False x DT torch.float32 26.5 28.1 16.4 16.5
N 1 x D 7168 x R True x DT torch.bfloat16 22.6 25.6 16.5 16.5
N 1 x D 7168 x R True x DT torch.float32 22.6 25.4 16.5 16.5
N 1 x D 7168 x R False x DT torch.bfloat16 25.2 27.9 16.5 16.6
N 1 x D 7168 x R False x DT torch.float32 25.2 28.2 16.5 16.7
N 16 x D 1024 x R True x DT torch.bfloat16 23.5 25.3 17 17.1
N 16 x D 1024 x R True x DT torch.float32 23.7 25.3 17 17.2
N 16 x D 1024 x R False x DT torch.bfloat16 26.3 27.7 17 17
N 16 x D 1024 x R False x DT torch.float32 26.2 27.9 17.1 17.1
N 16 x D 2048 x R True x DT torch.bfloat16 23.5 25.6 17.1 17.1
N 16 x D 2048 x R True x DT torch.float32 23.9 25.5 16.9 17.1
N 16 x D 2048 x R False x DT torch.bfloat16 26.3 27.9 17.1 17.1
N 16 x D 2048 x R False x DT torch.float32 26.5 27.7 17 16.9
N 16 x D 3072 x R True x DT torch.bfloat16 23.7 25.4 17 17.1
N 16 x D 3072 x R True x DT torch.float32 23.7 25.9 17.1 17.1
N 16 x D 3072 x R False x DT torch.bfloat16 26.3 28 17.1 17.1
N 16 x D 3072 x R False x DT torch.float32 26.4 28 16.8 17.1
N 16 x D 4096 x R True x DT torch.bfloat16 23.6 25.2 17.1 17.1
N 16 x D 4096 x R True x DT torch.float32 23.7 25.5 17 17
N 16 x D 4096 x R False x DT torch.bfloat16 26.1 27.7 16.9 16.9
N 16 x D 4096 x R False x DT torch.float32 26.4 28 17.1 17.1
N 16 x D 5120 x R True x DT torch.bfloat16 23.4 25.3 17.4 17.1
N 16 x D 5120 x R True x DT torch.float32 23.6 25.4 17.1 17
N 16 x D 5120 x R False x DT torch.bfloat16 26.4 28.2 17.1 17
N 16 x D 5120 x R False x DT torch.float32 26.3 28 17.1 17.1
N 16 x D 6144 x R True x DT torch.bfloat16 23.9 25.4 17.2 17.1
N 16 x D 6144 x R True x DT torch.float32 24.2 25.4 17 17.2
N 16 x D 6144 x R False x DT torch.bfloat16 26.4 27.9 17.1 17.4
N 16 x D 6144 x R False x DT torch.float32 26.6 27.9 17 17.1
N 16 x D 7168 x R True x DT torch.bfloat16 23.9 25.4 17 17.3
N 16 x D 7168 x R True x DT torch.float32 23.6 25.2 16.9 17.1
N 16 x D 7168 x R False x DT torch.bfloat16 26.3 27.9 17.1 17.1
N 16 x D 7168 x R False x DT torch.float32 26.4 27.9 16.9 16.9
N 32 x D 1024 x R True x DT torch.bfloat16 23.6 25.4 17 17.3
N 32 x D 1024 x R True x DT torch.float32 23.5 25.6 17.3 17.2
N 32 x D 1024 x R False x DT torch.bfloat16 26.5 28.1 17.1 17.2
N 32 x D 1024 x R False x DT torch.float32 26.5 28.1 17.1 17.3
N 32 x D 2048 x R True x DT torch.bfloat16 23.9 25.4 17.3 17.4
N 32 x D 2048 x R True x DT torch.float32 23.7 25.4 17.2 17.3
N 32 x D 2048 x R False x DT torch.bfloat16 26.5 28 17.3 17.2
N 32 x D 2048 x R False x DT torch.float32 26.4 28.2 17.1 17.2
N 32 x D 3072 x R True x DT torch.bfloat16 24.1 25.6 17.4 17.4
N 32 x D 3072 x R True x DT torch.float32 24.1 25.5 17.3 17.2
N 32 x D 3072 x R False x DT torch.bfloat16 26.5 28.1 17.2 17.2
N 32 x D 3072 x R False x DT torch.float32 26.5 27.8 17.3 17.2
N 32 x D 4096 x R True x DT torch.bfloat16 24 25.5 17 17.4
N 32 x D 4096 x R True x DT torch.float32 23.8 25.5 17.1 17.2
N 32 x D 4096 x R False x DT torch.bfloat16 26.4 27.8 16.9 17.1
N 32 x D 4096 x R False x DT torch.float32 26.5 28.1 16.9 17.1
N 32 x D 5120 x R True x DT torch.bfloat16 23.9 25.4 17.1 17.2
N 32 x D 5120 x R True x DT torch.float32 23.6 25.5 17.1 17
N 32 x D 5120 x R False x DT torch.bfloat16 26.3 28 17.1 17
N 32 x D 5120 x R False x DT torch.float32 26.4 28.2 17.2 17.1
N 32 x D 6144 x R True x DT torch.bfloat16 23.7 25.3 17.1 17.3
N 32 x D 6144 x R True x DT torch.float32 23.9 25.4 17 17.2
N 32 x D 6144 x R False x DT torch.bfloat16 26.6 28.2 17 17
N 32 x D 6144 x R False x DT torch.float32 26.5 28 17.2 17.2
N 32 x D 7168 x R True x DT torch.bfloat16 23.9 25.5 17.1 17.2
N 32 x D 7168 x R True x DT torch.float32 23.8 25.4 17 17.5
N 32 x D 7168 x R False x DT torch.bfloat16 26.4 28.2 17 17.3
N 32 x D 7168 x R False x DT torch.float32 26.3 28.1 17.1 17.2
N 64 x D 1024 x R True x DT torch.bfloat16 23.9 25.5 17.2 17.3
N 64 x D 1024 x R True x DT torch.float32 24 25.4 17.1 17.2
N 64 x D 1024 x R False x DT torch.bfloat16 26.4 27.9 17.1 17.2
N 64 x D 1024 x R False x DT torch.float32 26.5 28 17 17.1
N 64 x D 2048 x R True x DT torch.bfloat16 24.1 25.6 17.3 17.2
N 64 x D 2048 x R True x DT torch.float32 24 25.7 17.3 17.2
N 64 x D 2048 x R False x DT torch.bfloat16 26.4 28.1 17 17.2
N 64 x D 2048 x R False x DT torch.float32 26 28.1 17.1 17.3
N 64 x D 3072 x R True x DT torch.bfloat16 24 25.7 17.2 17.4
N 64 x D 3072 x R True x DT torch.float32 23.5 25.5 17.1 17.4
N 64 x D 3072 x R False x DT torch.bfloat16 26.4 27.9 17.2 17.2
N 64 x D 3072 x R False x DT torch.float32 26.7 28.1 17.2 17
N 64 x D 4096 x R True x DT torch.bfloat16 23.9 25.4 17.1 17.3
N 64 x D 4096 x R True x DT torch.float32 23.7 25.2 17.2 17.4
N 64 x D 4096 x R False x DT torch.bfloat16 26.4 27.9 17.2 17.2
N 64 x D 4096 x R False x DT torch.float32 26.4 28.2 17 17.2
N 64 x D 5120 x R True x DT torch.bfloat16 24 25.5 17.1 17.4
N 64 x D 5120 x R True x DT torch.float32 23.9 25.4 16.9 17
N 64 x D 5120 x R False x DT torch.bfloat16 26.3 27.9 17 16.9
N 64 x D 5120 x R False x DT torch.float32 26.2 27.8 17 17.1
N 64 x D 6144 x R True x DT torch.bfloat16 23.9 25.6 17 17.1
N 64 x D 6144 x R True x DT torch.float32 23.7 25.7 16.9 16.9
N 64 x D 6144 x R False x DT torch.bfloat16 26 28.1 17 17
N 64 x D 6144 x R False x DT torch.float32 25.9 28 16.9 16.9
N 64 x D 7168 x R True x DT torch.bfloat16 23.5 25.5 17 16.9
N 64 x D 7168 x R True x DT torch.float32 23.7 25.5 16.9 16.9
N 64 x D 7168 x R False x DT torch.bfloat16 26.1 27.9 17 17.3
N 64 x D 7168 x R False x DT torch.float32 26.6 28.1 17.1 17.4
N 128 x D 1024 x R True x DT torch.bfloat16 24 25.4 16.9 17.3
N 128 x D 1024 x R True x DT torch.float32 24.1 25.4 16.9 17.1
N 128 x D 1024 x R False x DT torch.bfloat16 26.1 28 16.8 17.1
N 128 x D 1024 x R False x DT torch.float32 26.2 27.9 16.9 17
N 128 x D 2048 x R True x DT torch.bfloat16 23.8 25.7 17 17.2
N 128 x D 2048 x R True x DT torch.float32 23.7 25.5 17.1 17.1
N 128 x D 2048 x R False x DT torch.bfloat16 26.4 28.1 17.2 17.1
N 128 x D 2048 x R False x DT torch.float32 26 27.9 16.9 17.3
N 128 x D 3072 x R True x DT torch.bfloat16 23.5 25.5 17 17
N 128 x D 3072 x R True x DT torch.float32 23.6 25.6 17.1 17.2
N 128 x D 3072 x R False x DT torch.bfloat16 26.3 28 17.2 17.2
N 128 x D 3072 x R False x DT torch.float32 26.3 27.9 17.2 17.2
N 128 x D 4096 x R True x DT torch.bfloat16 23.8 25.5 17.1 17.1
N 128 x D 4096 x R True x DT torch.float32 23.9 25.6 17 17.2
N 128 x D 4096 x R False x DT torch.bfloat16 26.4 27.8 17.3 17.4
N 128 x D 4096 x R False x DT torch.float32 26.4 27.9 17.2 17.3
N 128 x D 5120 x R True x DT torch.bfloat16 23.6 25.6 17.2 17.1
N 128 x D 5120 x R True x DT torch.float32 24.1 25.7 17.2 17.3
N 128 x D 5120 x R False x DT torch.bfloat16 26.3 27.9 17.1 17.1
N 128 x D 5120 x R False x DT torch.float32 26.3 28 16.9 17.1
N 128 x D 6144 x R True x DT torch.bfloat16 24.1 25.5 17.2 17.2
N 128 x D 6144 x R True x DT torch.float32 24.1 28.5 17.2 17.3
N 128 x D 6144 x R False x DT torch.bfloat16 26.2 28 17.3 17.3
N 128 x D 6144 x R False x DT torch.float32 26.4 28.1 17.1 17.2
N 128 x D 7168 x R True x DT torch.bfloat16 24.1 25.9 17.3 17.5
N 128 x D 7168 x R True x DT torch.float32 27.8 34.8 20.3 21.4
N 128 x D 7168 x R False x DT torch.bfloat16 26.5 28.2 16.9 17.1
N 128 x D 7168 x R False x DT torch.float32 26.2 28.6 17.1 16.9
N 256 x D 1024 x R True x DT torch.bfloat16 23.6 25.6 17 17.1
N 256 x D 1024 x R True x DT torch.float32 23.6 25.7 17 17.2
N 256 x D 1024 x R False x DT torch.bfloat16 26.4 28.2 17 17.2
N 256 x D 1024 x R False x DT torch.float32 26.5 28 17 17
N 256 x D 2048 x R True x DT torch.bfloat16 23.6 25.2 17 17
N 256 x D 2048 x R True x DT torch.float32 23.7 25.6 17.1 17.2
N 256 x D 2048 x R False x DT torch.bfloat16 26.5 28.2 17 16.9
N 256 x D 2048 x R False x DT torch.float32 26.4 28.1 17 17.2
N 256 x D 3072 x R True x DT torch.bfloat16 24.3 25.9 17.3 17.3
N 256 x D 3072 x R True x DT torch.float32 24.3 31.2 17.3 17.3
N 256 x D 3072 x R False x DT torch.bfloat16 26.3 28.2 17.2 17.1
N 256 x D 3072 x R False x DT torch.float32 26.7 28.4 17.2 17.2
N 256 x D 4096 x R True x DT torch.bfloat16 23.7 25.6 17.4 17.5
N 256 x D 4096 x R True x DT torch.float32 32.6 41.9 23 24.4
N 256 x D 4096 x R False x DT torch.bfloat16 26.5 28.2 17.3 17.3
N 256 x D 4096 x R False x DT torch.float32 26.9 36 17.1 17.1
N 256 x D 5120 x R True x DT torch.bfloat16 23.8 27 16.8 18
N 256 x D 5120 x R True x DT torch.float32 45.4 53.6 32.3 35.8
N 256 x D 5120 x R False x DT torch.bfloat16 26.5 30.2 17.3 17.2
N 256 x D 5120 x R False x DT torch.float32 32.9 41.8 17.2 17
N 256 x D 6144 x R True x DT torch.bfloat16 25.7 34.5 20.3 26.4
N 256 x D 6144 x R True x DT torch.float32 58.4 67.9 36.8 39.2
N 256 x D 6144 x R False x DT torch.bfloat16 28.5 36.8 17 17
N 256 x D 6144 x R False x DT torch.float32 41 50.2 18.2 20.5
N 256 x D 7168 x R True x DT torch.bfloat16 31 39.7 23.7 27.4
N 256 x D 7168 x R True x DT torch.float32 69.7 80.9 42.7 44.7
N 256 x D 7168 x R False x DT torch.bfloat16 32.2 41.4 17.2 17.1
N 256 x D 7168 x R False x DT torch.float32 48.9 59.6 19.7 22.2
N 512 x D 1024 x R True x DT torch.bfloat16 23.5 25.7 17.4 17.1
N 512 x D 1024 x R True x DT torch.float32 23.8 25.5 17.1 17.2
N 512 x D 1024 x R False x DT torch.bfloat16 26.7 28.1 17.2 17
N 512 x D 1024 x R False x DT torch.float32 26.6 28.5 17 17.4
N 512 x D 2048 x R True x DT torch.bfloat16 23.9 26.6 17.3 17.4
N 512 x D 2048 x R True x DT torch.float32 37.2 49.4 24.6 25.2
N 512 x D 2048 x R False x DT torch.bfloat16 26.4 31.9 17.1 17.3
N 512 x D 2048 x R False x DT torch.float32 29 40.8 17.2 17.2
N 512 x D 3072 x R True x DT torch.bfloat16 29.3 41 21.7 24.5
N 512 x D 3072 x R True x DT torch.float32 59.6 73.7 35.4 35.5
N 512 x D 3072 x R False x DT torch.bfloat16 30.5 41.9 17.2 18.1
N 512 x D 3072 x R False x DT torch.float32 40.2 51.9 18.9 21
N 512 x D 4096 x R True x DT torch.bfloat16 40 52.3 26.4 29.1
N 512 x D 4096 x R True x DT torch.float32 82.9 99.4 45.8 46.1
N 512 x D 4096 x R False x DT torch.bfloat16 40.2 50.7 18.4 21.6
N 512 x D 4096 x R False x DT torch.float32 52.9 69.2 21.7 24.5
N 512 x D 5120 x R True x DT torch.bfloat16 53.6 64.3 36 43.4
N 512 x D 5120 x R True x DT torch.float32 106 126.5 57.2 64.7
N 512 x D 5120 x R False x DT torch.bfloat16 49.3 59.4 24.1 29
N 512 x D 5120 x R False x DT torch.float32 65.3 83.8 28.5 32.8
N 512 x D 6144 x R True x DT torch.bfloat16 65.7 78.2 38.8 44.9
N 512 x D 6144 x R True x DT torch.float32 127.4 151 67.3 71.8
N 512 x D 6144 x R False x DT torch.bfloat16 57.6 68.8 25.7 31.1
N 512 x D 6144 x R False x DT torch.float32 75.3 98.5 30.4 34.7
N 512 x D 7168 x R True x DT torch.bfloat16 79.7 93.3 43.6 48.9
N 512 x D 7168 x R True x DT torch.float32 149.5 176.6 77.5 80.4
N 512 x D 7168 x R False x DT torch.bfloat16 66 79.1 27.4 33.3
N 512 x D 7168 x R False x DT torch.float32 88.2 113.7 33.6 37.5

PR Checklist (Click to Expand)

Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.

PR Title and Classification

Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:

  • [Bugfix] for bug fixes.
  • [CI/Build] for build or continuous integration improvements.
  • [Doc] for documentation fixes and improvements.
  • [Model] for adding a new model or improving an existing model. Model name should appear in the title.
  • [Frontend] For changes on the vLLM frontend (e.g., OpenAI API server, LLM class, etc.)
  • [Kernel] for changes affecting CUDA kernels or other compute kernels.
  • [Core] for changes in the core vLLM logic (e.g., LLMEngine, AsyncLLMEngine, Scheduler, etc.)
  • [Hardware][Vendor] for hardware-specific changes. Vendor name should appear in the prefix (e.g., [Hardware][AMD]).
  • [Misc] for PRs that do not fit the above categories. Please use this sparingly.

Note: If the PR spans more than one category, please include all relevant prefixes.

Code Quality

The PR need to meet the following code quality standards:

  • We adhere to Google Python style guide and Google C++ style guide.
  • Pass all linter checks. Please use format.sh to format your code.
  • The code need to be well-documented to ensure future contributors can easily understand the code.
  • Include sufficient tests to ensure the project to stay correct and robust. This includes both unit tests and integration tests.
  • Please add documentation to docs/source/ if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.

Notes for Large Changes

Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with rfc-required and might not go through the PR.

What to Expect for the Reviews

The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:

  • After the PR is submitted, the PR will be assigned to a reviewer. Every reviewer will pick up the PRs based on their expertise and availability.
  • After the PR is assigned, the reviewer will provide status update every 2-3 days. If the PR is not reviewed within 7 days, please feel free to ping the reviewer or the vLLM team.
  • After the review, the reviewer will put an action-required label on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.
  • Please respond to all comments within a reasonable time frame. If a comment isn't clear or you disagree with a suggestion, feel free to ask for clarification or discuss the suggestion.

Thank You

Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!

@varun-sundar-rabindranath varun-sundar-rabindranath marked this pull request as draft July 24, 2024 23:43
@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which consists a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of default ones by unblocking the steps in your fast-check build on Buildkite UI.

Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge).

To run full CI, you can do one of these:

  • Comment /ready on the PR
  • Add ready label to the PR
  • Enable auto-merge.

🚀

@varun-sundar-rabindranath
Copy link
Contributor Author

varun-sundar-rabindranath commented Jul 24, 2024

Marked it draft for now. Will open it up after some performance profiling. Done.

@varun-sundar-rabindranath varun-sundar-rabindranath marked this pull request as ready for review July 25, 2024 15:31
@varun-sundar-rabindranath
Copy link
Contributor Author

/ready

@github-actions github-actions bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jul 25, 2024
@varun-sundar-rabindranath varun-sundar-rabindranath force-pushed the varun/fused-rms-quant-dyn-per-token branch from 3642313 to c505155 Compare July 26, 2024 21:33
@varun-sundar-rabindranath varun-sundar-rabindranath changed the title [ Kernel ] Add Fused Layernorm + Dynamic-Per-Token Quant Kernels [Kernel] Add Fused Layernorm + Dynamic-Per-Token Quant Kernels Jul 26, 2024
Copy link
Member

@tlrmchlsmth tlrmchlsmth left a comment

Choose a reason for hiding this comment

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

Left some in-line comments. I see some potential issues with using int for large activations that will need to be resolved. Along those lines, I thing being explicit about using int32_t instead of int will improve things.

__device__ void compute_rms(float* rms, scalar_t const* __restrict__ input,
int const hidden_size, float const epsilon,
scalar_t const* __restrict__ residual = nullptr) {
int const token_offset = blockIdx.x * hidden_size;
Copy link
Member

Choose a reason for hiding this comment

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

this should be an int64_t

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this. Updated the ints to int32_t / int64_t 👍

Comment on lines 68 to 86
template <typename scalar_t, typename quant_type_t, bool is_scale_inverted>
__device__ void scaled_quant_conversion(quant_type_t* __restrict__ output,
scalar_t const* __restrict__ input,
float const scale, int const tid,
int const num_elements,
int const step) {
for (int i = tid; i < num_elements; i += step) {
output[i] = ScaledQuant<quant_type_t, is_scale_inverted>(input[i], scale);
}
}

namespace vectorized {

// Vectorized version of scaled_quant_conversion
template <typename scalar_t, typename quant_type_t, bool is_scale_inverted>
__device__ void scaled_quant_conversion(quant_type_t* __restrict__ out,
scalar_t const* __restrict__ input,
float const scale, int const tid,
int const num_elems, int const step) {
Copy link
Member

Choose a reason for hiding this comment

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

Are these functions used anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. it isn't yet. I plan to use them in the static-per-tensor case. On second thought, let me remove it from here and introduce it in static-per-tensor PR.

@github-actions
Copy link

github-actions bot commented Nov 1, 2024

This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you!

@github-actions github-actions bot added the stale Over 90 days of inactivity label Nov 1, 2024
@mergify mergify bot added the ci/build label Nov 1, 2024
@github-actions github-actions bot added unstale Recieved activity after being labelled stale and removed stale Over 90 days of inactivity labels Nov 4, 2024
@simon-mo simon-mo requested a review from WoosukKwon as a code owner November 26, 2024 05:49
@mergify
Copy link

mergify bot commented Nov 26, 2024

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @varun-sundar-rabindranath.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 26, 2024
@ProExpertProg
Copy link
Collaborator

@varun-sundar-rabindranath close in favor of #10906 ?

@varun-sundar-rabindranath
Copy link
Contributor Author

close in favor of #10906 . Thanks @ProExpertProg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build needs-rebase ready ONLY add when PR is ready to merge/full CI is needed unstale Recieved activity after being labelled stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants