import{s as pt,n as ht,o as ct}from"../chunks/scheduler.1f027d5a.js";import{S as dt,i as _t,e as i,s as o,c as m,h as ft,a as r,d as n,b as s,f as mt,g as u,j as l,k as ut,q as g,l as gt,m as a,n as p,t as h,o as c,p as d}from"../chunks/index.6117a65d.js";import{C as bt}from"../chunks/CopyLLMTxtMenu.610b106b.js";import{D as vt,C as Y}from"../chunks/DocNotebookDropdown.4ae0d470.js";import{H as ze,E as Tt}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.bd18ae98.js";function wt(Ge){let b,te,K,ne,v,ae,T,oe,w,se,k,je='本指南的目的是向你展示如何正确地对 TGI 进行基准测试。如需更多背景信息和解释，请先查看这篇<a href="https://huggingface.co/blog/tgi-benchmarking" rel="nofollow">热门博客</a>。',ie,x,re,y,De='确保你有一个已安装 TGI 的环境；Docker 是一个很好的选择。这里的命令可以很容易地复制/粘贴到终端中，这可能更为便捷。无需强制使用 Jupyter。如果你只是想测试一下，可以复制并使用<a href="https://huggingface.co/spaces/derek-thomas/tgi-benchmark-space" rel="nofollow">derek-thomas/tgi-benchmark-space</a>。',le,E,me,C,ue,N,He=`text-generation-launcher 2.2.1-dev0
`,pe,M,Be="以下是 TGI 的不同设置选项，请确保通读并决定哪些设置对你的使用场景最为重要。",he,$,Fe="以下是一些最重要的设置：",ce,A,Qe="<li><code>--model-id</code></li> <li><code>--quantize</code> 量化可以节省内存，但并不总是能提高速度</li> <li><code>--max-input-tokens</code> 这可以让 TGI 优化预填充操作</li> <li><code>--max-total-tokens</code> 与上述设置结合，TGI 现在知道最大输入和输出 token 的限制</li> <li><code>--max-batch-size</code> 这个设置让 TGI 知道它每次可以处理多少个请求。</li>",de,S,Ze="最后这三个设置共同提供了必要的限制，以便为你的使用场景进行优化。通过合理设置这些选项，你可以显著提高性能。",_e,U,fe,I,Xe=`Text Generation Launcher

\x1B[1m\x1B[4mUsage:\x1B[0m \x1B[1mtext-generation-launcher\x1B[0m [OPTIONS]

\x1B[1m\x1B[4mOptions:\x1B[0m
      \x1B[1m--model-id\x1B[0m <model_id>
          The name of the model to load. Can be a MODEL_ID as listed on <https: hf.co="" models=""> like \`gpt2\` or \`OpenAssistant/oasst-sft-1-pythia-12b\`. Or it can be a local directory containing the necessary files as saved by \`save_pretrained(...)\` methods of transformers [env: MODEL_ID=] [default: bigscience/bloom-560m]
      \x1B[1m--revision\x1B[0m <revision>
          The actual revision of the model if you&#39;re referring to a model on the hub. You can use a specific commit id or a branch like \`refs/pr/2\` [env: REVISION=]
      \x1B[1m--validation-workers\x1B[0m <validation_workers>
          The number of tokenizer workers used for payload validation and truncation inside the router [env: VALIDATION_WORKERS=] [default: 2]
      \x1B[1m--sharded\x1B[0m <sharded>
          Whether to shard the model across multiple GPUs By default text-generation-inference will use all available GPUs to run the model. Setting it to \`false\` deactivates \`num_shard\` [env: SHARDED=] [possible values: true, false]
      \x1B[1m--num-shard\x1B[0m <num_shard>
          The number of shards to use if you don&#39;t want to use all GPUs on a given machine. You can use \`CUDA_VISIBLE_DEVICES=0,1 text-generation-launcher... --num_shard 2\` and \`CUDA_VISIBLE_DEVICES=2,3 text-generation-launcher... --num_shard 2\` to launch 2 copies with 2 shard each on a given machine with 4 GPUs for instance [env: NUM_SHARD=]
      \x1B[1m--quantize\x1B[0m <quantize>
          Whether you want the model to be quantized [env: QUANTIZE=] [possible values: awq, eetq, exl2, gptq, marlin, bitsandbytes, bitsandbytes-nf4, bitsandbytes-fp4, fp8]
      \x1B[1m--speculate\x1B[0m <speculate>
          The number of input_ids to speculate on If using a medusa model, the heads will be picked up automatically Other wise, it will use n-gram speculation which is relatively free in terms of compute, but the speedup heavily depends on the task [env: SPECULATE=]
      \x1B[1m--dtype\x1B[0m <dtype>
          The dtype to be forced upon the model. This option cannot be used with \`--quantize\` [env: DTYPE=] [possible values: float16, bfloat16]
      \x1B[1m--trust-remote-code\x1B[0m
          Whether you want to execute hub modelling code. Explicitly passing a \`revision\` is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision [env: TRUST_REMOTE_CODE=]
      \x1B[1m--max-concurrent-requests\x1B[0m <max_concurrent_requests>
          The maximum amount of concurrent requests for this particular deployment. Having a low limit will refuse clients requests instead of having them wait for too long and is usually good to handle backpressure correctly [env: MAX_CONCURRENT_REQUESTS=] [default: 128]
      \x1B[1m--max-best-of\x1B[0m <max_best_of>
          This is the maximum allowed value for clients to set \`best_of\`. Best of makes \`n\` generations at the same time, and return the best in terms of overall log probability over the entire generated sequence [env: MAX_BEST_OF=] [default: 2]
      \x1B[1m--max-stop-sequences\x1B[0m <max_stop_sequences>
          This is the maximum allowed value for clients to set \`stop_sequences\`. Stop sequences are used to allow the model to stop on more than just the EOS token, and enable more complex &quot;prompting&quot; where users can preprompt the model in a specific way and define their &quot;own&quot; stop token aligned with their prompt [env: MAX_STOP_SEQUENCES=] [default: 4]
      \x1B[1m--max-top-n-tokens\x1B[0m <max_top_n_tokens>
          This is the maximum allowed value for clients to set \`top_n_tokens\`. \`top_n_tokens\` is used to return information about the the \`n\` most likely tokens at each generation step, instead of just the sampled token. This information can be used for downstream tasks like for classification or ranking [env: MAX_TOP_N_TOKENS=] [default: 5]
      \x1B[1m--max-input-tokens\x1B[0m <max_input_tokens>
          This is the maximum allowed input length (expressed in number of tokens) for users. The larger this value, the longer prompt users can send which can impact the overall memory required to handle the load. Please note that some models have a finite range of sequence they can handle. Default to min(max_position_embeddings - 1, 4095) [env: MAX_INPUT_TOKENS=]
      \x1B[1m--max-input-length\x1B[0m <max_input_length>
          Legacy version of [\`Args::max_input_tokens\`] [env: MAX_INPUT_LENGTH=]
      \x1B[1m--max-total-tokens\x1B[0m <max_total_tokens>
          This is the most important value to set as it defines the &quot;memory budget&quot; of running clients requests. Clients will send input sequences and ask to generate \`max_new_tokens\` on top. with a value of \`1512\` users can send either a prompt of \`1000\` and ask for \`512\` new tokens, or send a prompt of \`1\` and ask for \`1511\` max_new_tokens. The larger this value, the larger amount each request will be in your RAM and the less effective batching can be. Default to min(max_position_embeddings, 4096) [env: MAX_TOTAL_TOKENS=]
      \x1B[1m--waiting-served-ratio\x1B[0m <waiting_served_ratio>
          This represents the ratio of waiting queries vs running queries where you want to start considering pausing the running queries to include the waiting ones into the same batch. \`waiting_served_ratio=1.2\` Means when 12 queries are waiting and there&#39;s only 10 queries left in the current batch we check if we can fit those 12 waiting queries into the batching strategy, and if yes, then batching happens delaying the 10 running queries by a \`prefill\` run [env: WAITING_SERVED_RATIO=] [default: 0.3]
      \x1B[1m--max-batch-prefill-tokens\x1B[0m <max_batch_prefill_tokens>
          Limits the number of tokens for the prefill operation. Since this operation take the most memory and is compute bound, it is interesting to limit the number of requests that can be sent. Default to \`max_input_tokens + 50\` to give a bit of room [env: MAX_BATCH_PREFILL_TOKENS=]
      \x1B[1m--max-batch-total-tokens\x1B[0m <max_batch_total_tokens>
          **IMPORTANT** This is one critical control to allow maximum usage of the available hardware [env: MAX_BATCH_TOTAL_TOKENS=]
      \x1B[1m--max-waiting-tokens\x1B[0m <max_waiting_tokens>
          This setting defines how many tokens can be passed before forcing the waiting queries to be put on the batch (if the size of the batch allows for it). New queries require 1 \`prefill\` forward, which is different from \`decode\` and therefore you need to pause the running batch in order to run \`prefill\` to create the correct values for the waiting queries to be able to join the batch [env: MAX_WAITING_TOKENS=] [default: 20]
      \x1B[1m--max-batch-size\x1B[0m <max_batch_size>
          Enforce a maximum number of requests per batch Specific flag for hardware targets that do not support unpadded inference [env: MAX_BATCH_SIZE=]
      \x1B[1m--cuda-graphs\x1B[0m <cuda_graphs>
          Specify the batch sizes to compute cuda graphs for. Use &quot;0&quot; to disable. Default = &quot;1,2,4,8,16,32&quot; [env: CUDA_GRAPHS=]
      \x1B[1m--hostname\x1B[0m <hostname>
          The IP address to listen on [env: HOSTNAME=r-derek-thomas-tgi-benchmark-space-geij6846-b385a-lont4] [default: 0.0.0.0]
  \x1B[1m-p\x1B[0m, \x1B[1m--port\x1B[0m <port>
          The port to listen on [env: PORT=80] [default: 3000]
      \x1B[1m--shard-uds-path\x1B[0m <shard_uds_path>
          The name of the socket for gRPC communication between the webserver and the shards [env: SHARD_UDS_PATH=] [default: /tmp/text-generation-server]
      \x1B[1m--master-addr\x1B[0m <master_addr>
          The address the master shard will listen on. (setting used by torch distributed) [env: MASTER_ADDR=] [default: localhost]
      \x1B[1m--master-port\x1B[0m <master_port>
          The address the master port will listen on. (setting used by torch distributed) [env: MASTER_PORT=] [default: 29500]
      \x1B[1m--huggingface-hub-cache\x1B[0m <huggingface_hub_cache>
          The location of the huggingface hub cache. Used to override the location if you want to provide a mounted disk for instance [env: HUGGINGFACE_HUB_CACHE=]
      \x1B[1m--weights-cache-override\x1B[0m <weights_cache_override>
          The location of the huggingface hub cache. Used to override the location if you want to provide a mounted disk for instance [env: WEIGHTS_CACHE_OVERRIDE=]
      \x1B[1m--disable-custom-kernels\x1B[0m
          For some models (like bloom), text-generation-inference implemented custom cuda kernels to speed up inference. Those kernels were only tested on A100. Use this flag to disable them if you&#39;re running on different hardware and encounter issues [env: DISABLE_CUSTOM_KERNELS=]
      \x1B[1m--cuda-memory-fraction\x1B[0m <cuda_memory_fraction>
          Limit the CUDA available memory. The allowed value equals the total visible memory multiplied by cuda-memory-fraction [env: CUDA_MEMORY_FRACTION=] [default: 1.0]
      \x1B[1m--rope-scaling\x1B[0m <rope_scaling>
          Rope scaling will only be used for RoPE models and allow rescaling the position rotary to accomodate for larger prompts [env: ROPE_SCALING=] [possible values: linear, dynamic]
      \x1B[1m--rope-factor\x1B[0m <rope_factor>
          Rope scaling will only be used for RoPE models See \`rope_scaling\` [env: ROPE_FACTOR=]
      \x1B[1m--json-output\x1B[0m
          Outputs the logs in JSON format (useful for telemetry) [env: JSON_OUTPUT=]
      \x1B[1m--otlp-endpoint\x1B[0m <otlp_endpoint>
          [env: OTLP_ENDPOINT=]
      \x1B[1m--otlp-service-name\x1B[0m <otlp_service_name>
          [env: OTLP_SERVICE_NAME=] [default: text-generation-inference.router]
      \x1B[1m--cors-allow-origin\x1B[0m <cors_allow_origin>
          [env: CORS_ALLOW_ORIGIN=]
      \x1B[1m--api-key\x1B[0m <api_key>
          [env: API_KEY=]
      \x1B[1m--watermark-gamma\x1B[0m <watermark_gamma>
          [env: WATERMARK_GAMMA=]
      \x1B[1m--watermark-delta\x1B[0m <watermark_delta>
          [env: WATERMARK_DELTA=]
      \x1B[1m--ngrok\x1B[0m
          Enable ngrok tunneling [env: NGROK=]
      \x1B[1m--ngrok-authtoken\x1B[0m <ngrok_authtoken>
          ngrok authentication token [env: NGROK_AUTHTOKEN=]
      \x1B[1m--ngrok-edge\x1B[0m <ngrok_edge>
          ngrok edge [env: NGROK_EDGE=]
      \x1B[1m--tokenizer-config-path\x1B[0m <tokenizer_config_path>
          The path to the tokenizer config file. This path is used to load the tokenizer configuration which may include a \`chat_template\`. If not provided, the default config will be used from the model hub [env: TOKENIZER_CONFIG_PATH=]
      \x1B[1m--disable-grammar-support\x1B[0m
          Disable outlines grammar constrained generation. This is a feature that allows you to generate text that follows a specific grammar [env: DISABLE_GRAMMAR_SUPPORT=]
  \x1B[1m-e\x1B[0m, \x1B[1m--env\x1B[0m
          Display a lot of information about your runtime environment
      \x1B[1m--max-client-batch-size\x1B[0m <max_client_batch_size>
          Control the maximum number of inputs that a client can send in a single request [env: MAX_CLIENT_BATCH_SIZE=] [default: 4]
      \x1B[1m--lora-adapters\x1B[0m <lora_adapters>
          Lora Adapters a list of adapter ids i.e. \`repo/adapter1,repo/adapter2\` to load during startup that will be available to callers via the \`adapter_id\` field in a request [env: LORA_ADAPTERS=]
      \x1B[1m--usage-stats\x1B[0m <usage_stats>
          Control if anonymous usage stats are collected. Options are &quot;on&quot;, &quot;off&quot; and &quot;no-stack&quot; Defaul is on [env: USAGE_STATS=] [default: on] [possible values: on, off, no-stack]
  \x1B[1m-h\x1B[0m, \x1B[1m--help\x1B[0m
          Print help (see more with &#39;--help&#39;)
  \x1B[1m-V\x1B[0m, \x1B[1m--version\x1B[0m
          Print version
</usage_stats></lora_adapters></max_client_batch_size></tokenizer_config_path></ngrok_edge></ngrok_authtoken></watermark_delta></watermark_gamma></api_key></cors_allow_origin></otlp_service_name></otlp_endpoint></rope_factor></rope_scaling></cuda_memory_fraction></weights_cache_override></huggingface_hub_cache></master_port></master_addr></shard_uds_path></port></hostname></cuda_graphs></max_batch_size></max_waiting_tokens></max_batch_total_tokens></max_batch_prefill_tokens></waiting_served_ratio></max_total_tokens></max_input_length></max_input_tokens></max_top_n_tokens></max_stop_sequences></max_best_of></max_concurrent_requests></dtype></speculate></quantize></num_shard></sharded></validation_workers></revision></https:></model_id>`,ge,R,Je="我们可以直接从本指南中启动，因为我们不需要命令是交互式的。",be,O,Ve="在本指南中，我们将使用默认设置，因为目的是理解基准测试工具。",ve,L,We="如果你在 Space 上运行，以下参数已被更改，因为我们不希望与 Spaces 服务器发生冲突：",Te,P,Ye="<li><code>--hostname</code></li> <li><code>--port</code></li>",we,q,Ke="根据你的需求，你可以随意更改或删除这些参数。",ke,z,xe,G,et=`\x1B[2m2024-08-16T12:07:56.411768Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Args &#123;
    model_id: "astronomer/Llama-3-8B-Instruct-GPTQ-8-Bit",
    revision: None,
    validation_workers: 2,
    sharded: None,
    num_shard: None,
    quantize: Some(
        Gptq,
    ),
    speculate: None,
    dtype: None,
    trust_remote_code: false,
    max_concurrent_requests: 128,
    max_best_of: 2,
    max_stop_sequences: 4,
    max_top_n_tokens: 5,
    max_input_tokens: None,
    max_input_length: None,
    max_total_tokens: None,
    waiting_served_ratio: 0.3,
    max_batch_prefill_tokens: None,
    max_batch_total_tokens: None,
    max_waiting_tokens: 20,
    max_batch_size: None,
    cuda_graphs: None,
    hostname: "0.0.0.0",
    port: 1337,
    shard_uds_path: "/tmp/text-generation-server",
    master_addr: "localhost",
    master_port: 29500,
    huggingface_hub_cache: None,
    weights_cache_override: None,
    disable_custom_kernels: false,
    cuda_memory_fraction: 1.0,
    rope_scaling: None,
    rope_factor: None,
    json_output: false,
    otlp_endpoint: None,
    otlp_service_name: "text-generation-inference.router",
    cors_allow_origin: [],
    api_key: None,
    watermark_gamma: None,
    watermark_delta: None,
    ngrok: false,
    ngrok_authtoken: None,
    ngrok_edge: None,
    tokenizer_config_path: None,
    disable_grammar_support: false,
    env: false,
    max_client_batch_size: 4,
    lora_adapters: None,
    usage_stats: On,
}
\x1B[2m2024-08-16T12:07:56.411941Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mhf_hub\x1B[0m\x1B[2m:\x1B[0m Token file not found "/data/token"    
\x1B[2Kconfig.json [00:00:00] [████████████████████████] 1021 B/1021 B 50.70 KiB/s (0s)\x1B[2m2024-08-16T12:07:56.458451Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Model supports up to 8192 but tgi will now set its default to 4096 instead. This is to save VRAM by refusing large prompts in order to allow more users on the same hardware. You can increase that size using \`--max-batch-prefill-tokens=8242 --max-total-tokens=8192 --max-input-tokens=8191\`.
\x1B[2m2024-08-16T12:07:56.458473Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Default \`max_input_tokens\` to 4095
\x1B[2m2024-08-16T12:07:56.458480Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Default \`max_total_tokens\` to 4096
\x1B[2m2024-08-16T12:07:56.458487Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Default \`max_batch_prefill_tokens\` to 4145
\x1B[2m2024-08-16T12:07:56.458494Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Using default cuda graphs [1, 2, 4, 8, 16, 32]
\x1B[2m2024-08-16T12:07:56.458606Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[1mdownload\x1B[0m: \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Starting check and download process for astronomer/Llama-3-8B-Instruct-GPTQ-8-Bit
\x1B[2m2024-08-16T12:07:59.750101Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Download file: model.safetensors
^C
\x1B[2m2024-08-16T12:08:09.101893Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[1mdownload\x1B[0m: \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Terminating download
\x1B[2m2024-08-16T12:08:09.102368Z\x1B[0m \x1B[32m INFO\x1B[0m \x1B[1mdownload\x1B[0m: \x1B[2mtext_generation_launcher\x1B[0m\x1B[2m:\x1B[0m Waiting for download to gracefully shutdown
`,ye,j,Ee,D,tt="现在让我们学习如何启动基准测试工具！",Ce,H,nt="在这里，我们可以看到 TGI 基准测试的不同设置选项。",Ne,B,at="以下是一些更重要的 TGI 基准测试设置：",Me,F,ot="<li><code>--tokenizer-name</code> 这是必需的，以便工具知道使用哪个分词器</li> <li><code>--batch-size</code> 这对于负载测试非常重要。我们应该使用足够的值来查看吞吐量和延迟的变化。请注意，在基准测试工具中，batch-size 是虚拟用户的数量。</li> <li><code>--sequence-length</code> 也就是输入 tokens，这对于匹配你的使用场景需求非常重要</li> <li><code>--decode-length</code> 也就是输出 tokens，这对于匹配你的使用场景需求非常重要</li> <li><code>--runs</code> 默认值是 10</li>",$e,_,st='<strong>💡 提示：</strong> 当你在探索时，使用较小的 <code style="background: #37474F; color: #FFFFFF; padding: 2px 4px; border-radius: 4px;">--runs</code> 值，但在最终确定时使用较高的值，以获得更精确的统计数据。',Ae,Q,Se,Z,it=`Text Generation Benchmarking tool

\x1B[1m\x1B[4mUsage:\x1B[0m \x1B[1mtext-generation-benchmark\x1B[0m [OPTIONS] \x1B[1m--tokenizer-name\x1B[0m <tokenizer_name>

\x1B[1m\x1B[4mOptions:\x1B[0m
  \x1B[1m-t\x1B[0m, \x1B[1m--tokenizer-name\x1B[0m <tokenizer_name>
          The name of the tokenizer (as in model_id on the huggingface hub, or local path) [env: TOKENIZER_NAME=]
      \x1B[1m--revision\x1B[0m <revision>
          The revision to use for the tokenizer if on the hub [env: REVISION=] [default: main]
  \x1B[1m-b\x1B[0m, \x1B[1m--batch-size\x1B[0m <batch_size>
          The various batch sizes to benchmark for, the idea is to get enough batching to start seeing increased latency, this usually means you&#39;re moving from memory bound (usual as BS=1) to compute bound, and this is a sweet spot for the maximum batch size for the model under test
  \x1B[1m-s\x1B[0m, \x1B[1m--sequence-length\x1B[0m <sequence_length>
          This is the initial prompt sent to the text-generation-server length in token. Longer prompt will slow down the benchmark. Usually the latency grows somewhat linearly with this for the prefill step [env: SEQUENCE_LENGTH=] [default: 10]
  \x1B[1m-d\x1B[0m, \x1B[1m--decode-length\x1B[0m <decode_length>
          This is how many tokens will be generated by the server and averaged out to give the \`decode\` latency. This is the *critical* number you want to optimize for LLM spend most of their time doing decoding [env: DECODE_LENGTH=] [default: 8]
  \x1B[1m-r\x1B[0m, \x1B[1m--runs\x1B[0m <runs>
          How many runs should we average from [env: RUNS=] [default: 10]
  \x1B[1m-w\x1B[0m, \x1B[1m--warmups\x1B[0m <warmups>
          Number of warmup cycles [env: WARMUPS=] [default: 1]
  \x1B[1m-m\x1B[0m, \x1B[1m--master-shard-uds-path\x1B[0m <master_shard_uds_path>
          The location of the grpc socket. This benchmark tool bypasses the router completely and directly talks to the gRPC processes [env: MASTER_SHARD_UDS_PATH=] [default: /tmp/text-generation-server-0]
      \x1B[1m--temperature\x1B[0m <temperature>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: TEMPERATURE=]
      \x1B[1m--top-k\x1B[0m <top_k>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: TOP_K=]
      \x1B[1m--top-p\x1B[0m <top_p>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: TOP_P=]
      \x1B[1m--typical-p\x1B[0m <typical_p>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: TYPICAL_P=]
      \x1B[1m--repetition-penalty\x1B[0m <repetition_penalty>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: REPETITION_PENALTY=]
      \x1B[1m--frequency-penalty\x1B[0m <frequency_penalty>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: FREQUENCY_PENALTY=]
      \x1B[1m--watermark\x1B[0m
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: WATERMARK=]
      \x1B[1m--do-sample\x1B[0m
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: DO_SAMPLE=]
      \x1B[1m--top-n-tokens\x1B[0m <top_n_tokens>
          Generation parameter in case you want to specifically test/debug particular decoding strategies, for full doc refer to the \`text-generation-server\` [env: TOP_N_TOKENS=]
  \x1B[1m-h\x1B[0m, \x1B[1m--help\x1B[0m
          Print help (see more with &#39;--help&#39;)
  \x1B[1m-V\x1B[0m, \x1B[1m--version\x1B[0m
          Print version
</top_n_tokens></frequency_penalty></repetition_penalty></typical_p></top_p></top_k></temperature></master_shard_uds_path></warmups></runs></decode_length></sequence_length></batch_size></revision></tokenizer_name></tokenizer_name>`,Ue,X,rt="这是一个示例命令。请注意，我多次添加了感兴趣的 batch sizes，以确保所有的值都能被基准测试工具使用。我还根据预计的用户活动，考虑了哪些 batch sizes 是重要的。",Ie,f,lt="<strong>⚠️ 警告：</strong> 请注意，TGI 基准测试工具是设计用来在终端中运行的，而不是在 Jupyter 笔记本中。这意味着你需要将命令复制/粘贴到 Jupyter 终端标签中。我在这里放置它是为了方便。",Re,J,Oe,V,Le,W,Pe,ee,qe;return v=new vt({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/zh-CN/benchmarking_tgi.ipynb"}]}}),T=new bt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),w=new ze({props:{title:"介绍",local:"介绍",headingTag:"h1"}}),x=new ze({props:{title:"设置",local:"设置",headingTag:"h2"}}),E=new ze({props:{title:"TGI 启动器",local:"tgi-启动器",headingTag:"h1"}}),C=new Y({props:{code:"IXRleHQtZ2VuZXJhdGlvbi1sYXVuY2hlciUyMC0tdmVyc2lvbg==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>!text-generation-launcher --version',wrap:!1}}),U=new Y({props:{code:"IXRleHQtZ2VuZXJhdGlvbi1sYXVuY2hlciUyMC1o",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>!text-generation-launcher -h',wrap:!1}}),z=new Y({props:{code:"IVJVU1RfQkFDS1RSQUNFJTNEMSUyMCU1QyUwQXRleHQtZ2VuZXJhdGlvbi1sYXVuY2hlciUyMCU1QyUwQS0tbW9kZWwtaWQlMjBhc3Ryb25vbWVyJTJGTGxhbWEtMy04Qi1JbnN0cnVjdC1HUFRRLTgtQml0JTIwJTVDJTBBLS1xdWFudGl6ZSUyMGdwdHElMjAlNUMlMEEtLWhvc3RuYW1lJTIwMC4wLjAuMCUyMCU1QyUwQS0tcG9ydCUyMDEzMzc=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>!RUST_BACKTRACE=<span class="hljs-number">1</span> \\
<span class="hljs-meta">&gt;&gt;&gt; </span>text-generation-launcher \\
<span class="hljs-meta">&gt;&gt;&gt; </span>--model-<span class="hljs-built_in">id</span> astronomer/Llama-<span class="hljs-number">3</span>-8B-Instruct-GPTQ-<span class="hljs-number">8</span>-Bit \\
<span class="hljs-meta">&gt;&gt;&gt; </span>--quantize gptq \\
<span class="hljs-meta">&gt;&gt;&gt; </span>--hostname <span class="hljs-number">0.0</span><span class="hljs-number">.0</span><span class="hljs-number">.0</span> \\
<span class="hljs-meta">&gt;&gt;&gt; </span>--port <span class="hljs-number">1337</span>`,wrap:!1}}),j=new ze({props:{title:"TGI 基准测试",local:"tgi-基准测试",headingTag:"h1"}}),Q=new Y({props:{code:"IXRleHQtZ2VuZXJhdGlvbi1iZW5jaG1hcmslMjAtaA==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>!text-generation-benchmark -h',wrap:!1}}),J=new Y({props:{code:"IXRleHQtZ2VuZXJhdGlvbi1iZW5jaG1hcmslMjAlNUMlMEEtLXRva2VuaXplci1uYW1lJTIwYXN0cm9ub21lciUyRkxsYW1hLTMtOEItSW5zdHJ1Y3QtR1BUUS04LUJpdCUyMCU1QyUwQS0tc2VxdWVuY2UtbGVuZ3RoJTIwNzAlMjAlNUMlMEEtLWRlY29kZS1sZW5ndGglMjA1MCUyMCU1QyUwQS0tYmF0Y2gtc2l6ZSUyMDElMjAlNUMlMEEtLWJhdGNoLXNpemUlMjAyJTIwJTVDJTBBLS1iYXRjaC1zaXplJTIwNCUyMCU1QyUwQS0tYmF0Y2gtc2l6ZSUyMDglMjAlNUMlMEEtLWJhdGNoLXNpemUlMjAxNiUyMCU1QyUwQS0tYmF0Y2gtc2l6ZSUyMDMyJTIwJTVDJTBBLS1iYXRjaC1zaXplJTIwNjQlMjAlNUMlMEEtLWJhdGNoLXNpemUlMjAxMjg=",highlighted:`!text-generation-benchmark \\
--tokenizer-name astronomer/Llama-<span class="hljs-number">3</span>-8B-Instruct-GPTQ-<span class="hljs-number">8</span>-Bit \\
--sequence-length <span class="hljs-number">70</span> \\
--decode-length <span class="hljs-number">50</span> \\
--batch-size <span class="hljs-number">1</span> \\
--batch-size <span class="hljs-number">2</span> \\
--batch-size <span class="hljs-number">4</span> \\
--batch-size <span class="hljs-number">8</span> \\
--batch-size <span class="hljs-number">16</span> \\
--batch-size <span class="hljs-number">32</span> \\
--batch-size <span class="hljs-number">64</span> \\
--batch-size <span class="hljs-number">128</span>`,wrap:!1}}),V=new Y({props:{code:"",highlighted:"",wrap:!1}}),W=new Tt({props:{source:"https://github.com/huggingface/cookbook/blob/main/notebooks/zh-CN/benchmarking_tgi.md"}}),{c(){b=i("meta"),te=o(),K=i("p"),ne=o(),m(v.$$.fragment),ae=o(),m(T.$$.fragment),oe=o(),m(w.$$.fragment),se=o(),k=i("p"),k.innerHTML=je,ie=o(),m(x.$$.fragment),re=o(),y=i("p"),y.innerHTML=De,le=o(),m(E.$$.fragment),me=o(),m(C.$$.fragment),ue=o(),N=i("pre"),N.textContent=He,pe=o(),M=i("p"),M.textContent=Be,he=o(),$=i("p"),$.textContent=Fe,ce=o(),A=i("ul"),A.innerHTML=Qe,de=o(),S=i("p"),S.textContent=Ze,_e=o(),m(U.$$.fragment),fe=o(),I=i("pre"),I.innerHTML=Xe,ge=o(),R=i("p"),R.textContent=Je,be=o(),O=i("p"),O.textContent=Ve,ve=o(),L=i("p"),L.textContent=We,Te=o(),P=i("ul"),P.innerHTML=Ye,we=o(),q=i("p"),q.textContent=Ke,ke=o(),m(z.$$.fragment),xe=o(),G=i("pre"),G.textContent=et,ye=o(),m(j.$$.fragment),Ee=o(),D=i("p"),D.textContent=tt,Ce=o(),H=i("p"),H.textContent=nt,Ne=o(),B=i("p"),B.textContent=at,Me=o(),F=i("ul"),F.innerHTML=ot,$e=o(),_=i("blockquote"),_.innerHTML=st,Ae=o(),m(Q.$$.fragment),Se=o(),Z=i("pre"),Z.innerHTML=it,Ue=o(),X=i("p"),X.textContent=rt,Ie=o(),f=i("blockquote"),f.innerHTML=lt,Re=o(),m(J.$$.fragment),Oe=o(),m(V.$$.fragment),Le=o(),m(W.$$.fragment),Pe=o(),ee=i("p"),this.h()},l(e){const t=ft("svelte-u9bgzb",document.head);b=r(t,"META",{name:!0,content:!0}),t.forEach(n),te=s(e),K=r(e,"P",{}),mt(K).forEach(n),ne=s(e),u(v.$$.fragment,e),ae=s(e),u(T.$$.fragment,e),oe=s(e),u(w.$$.fragment,e),se=s(e),k=r(e,"P",{"data-svelte-h":!0}),l(k)!=="svelte-1frmc61"&&(k.innerHTML=je),ie=s(e),u(x.$$.fragment,e),re=s(e),y=r(e,"P",{"data-svelte-h":!0}),l(y)!=="svelte-1vgsoqu"&&(y.innerHTML=De),le=s(e),u(E.$$.fragment,e),me=s(e),u(C.$$.fragment,e),ue=s(e),N=r(e,"PRE",{"data-svelte-h":!0}),l(N)!=="svelte-5uago"&&(N.textContent=He),pe=s(e),M=r(e,"P",{"data-svelte-h":!0}),l(M)!=="svelte-heukeo"&&(M.textContent=Be),he=s(e),$=r(e,"P",{"data-svelte-h":!0}),l($)!=="svelte-1lbz8ww"&&($.textContent=Fe),ce=s(e),A=r(e,"UL",{"data-svelte-h":!0}),l(A)!=="svelte-zgfnyl"&&(A.innerHTML=Qe),de=s(e),S=r(e,"P",{"data-svelte-h":!0}),l(S)!=="svelte-14cluov"&&(S.textContent=Ze),_e=s(e),u(U.$$.fragment,e),fe=s(e),I=r(e,"PRE",{"data-svelte-h":!0}),l(I)!=="svelte-1sc2cl"&&(I.innerHTML=Xe),ge=s(e),R=r(e,"P",{"data-svelte-h":!0}),l(R)!=="svelte-1h3zte4"&&(R.textContent=Je),be=s(e),O=r(e,"P",{"data-svelte-h":!0}),l(O)!=="svelte-1xul5uz"&&(O.textContent=Ve),ve=s(e),L=r(e,"P",{"data-svelte-h":!0}),l(L)!=="svelte-68g9fr"&&(L.textContent=We),Te=s(e),P=r(e,"UL",{"data-svelte-h":!0}),l(P)!=="svelte-1ko3p04"&&(P.innerHTML=Ye),we=s(e),q=r(e,"P",{"data-svelte-h":!0}),l(q)!=="svelte-17viiyu"&&(q.textContent=Ke),ke=s(e),u(z.$$.fragment,e),xe=s(e),G=r(e,"PRE",{"data-svelte-h":!0}),l(G)!=="svelte-50c5je"&&(G.textContent=et),ye=s(e),u(j.$$.fragment,e),Ee=s(e),D=r(e,"P",{"data-svelte-h":!0}),l(D)!=="svelte-1r1tbrz"&&(D.textContent=tt),Ce=s(e),H=r(e,"P",{"data-svelte-h":!0}),l(H)!=="svelte-ai1t7s"&&(H.textContent=nt),Ne=s(e),B=r(e,"P",{"data-svelte-h":!0}),l(B)!=="svelte-164jva0"&&(B.textContent=at),Me=s(e),F=r(e,"UL",{"data-svelte-h":!0}),l(F)!=="svelte-pckk5h"&&(F.innerHTML=ot),$e=s(e),_=r(e,"BLOCKQUOTE",{style:!0,"data-svelte-h":!0}),l(_)!=="svelte-1w1k5y4"&&(_.innerHTML=st),Ae=s(e),u(Q.$$.fragment,e),Se=s(e),Z=r(e,"PRE",{"data-svelte-h":!0}),l(Z)!=="svelte-1nepnpv"&&(Z.innerHTML=it),Ue=s(e),X=r(e,"P",{"data-svelte-h":!0}),l(X)!=="svelte-1ynasyn"&&(X.textContent=rt),Ie=s(e),f=r(e,"BLOCKQUOTE",{style:!0,"data-svelte-h":!0}),l(f)!=="svelte-yy1mxm"&&(f.innerHTML=lt),Re=s(e),u(J.$$.fragment,e),Oe=s(e),u(V.$$.fragment,e),Le=s(e),u(W.$$.fragment,e),Pe=s(e),ee=r(e,"P",{}),mt(ee).forEach(n),this.h()},h(){ut(b,"name","hf:doc:metadata"),ut(b,"content",kt),g(_,"border-left","5px solid #80CBC4"),g(_,"background","#263238"),g(_,"color","#CFD8DC"),g(_,"padding","0.5em 1em"),g(_,"margin","1em 0"),g(f,"border-left","5px solid #FFAB91"),g(f,"background","#37474F"),g(f,"color","#FFCCBC"),g(f,"padding","0.5em 1em"),g(f,"margin","1em 0")},m(e,t){gt(document.head,b),a(e,te,t),a(e,K,t),a(e,ne,t),p(v,e,t),a(e,ae,t),p(T,e,t),a(e,oe,t),p(w,e,t),a(e,se,t),a(e,k,t),a(e,ie,t),p(x,e,t),a(e,re,t),a(e,y,t),a(e,le,t),p(E,e,t),a(e,me,t),p(C,e,t),a(e,ue,t),a(e,N,t),a(e,pe,t),a(e,M,t),a(e,he,t),a(e,$,t),a(e,ce,t),a(e,A,t),a(e,de,t),a(e,S,t),a(e,_e,t),p(U,e,t),a(e,fe,t),a(e,I,t),a(e,ge,t),a(e,R,t),a(e,be,t),a(e,O,t),a(e,ve,t),a(e,L,t),a(e,Te,t),a(e,P,t),a(e,we,t),a(e,q,t),a(e,ke,t),p(z,e,t),a(e,xe,t),a(e,G,t),a(e,ye,t),p(j,e,t),a(e,Ee,t),a(e,D,t),a(e,Ce,t),a(e,H,t),a(e,Ne,t),a(e,B,t),a(e,Me,t),a(e,F,t),a(e,$e,t),a(e,_,t),a(e,Ae,t),p(Q,e,t),a(e,Se,t),a(e,Z,t),a(e,Ue,t),a(e,X,t),a(e,Ie,t),a(e,f,t),a(e,Re,t),p(J,e,t),a(e,Oe,t),p(V,e,t),a(e,Le,t),p(W,e,t),a(e,Pe,t),a(e,ee,t),qe=!0},p:ht,i(e){qe||(h(v.$$.fragment,e),h(T.$$.fragment,e),h(w.$$.fragment,e),h(x.$$.fragment,e),h(E.$$.fragment,e),h(C.$$.fragment,e),h(U.$$.fragment,e),h(z.$$.fragment,e),h(j.$$.fragment,e),h(Q.$$.fragment,e),h(J.$$.fragment,e),h(V.$$.fragment,e),h(W.$$.fragment,e),qe=!0)},o(e){c(v.$$.fragment,e),c(T.$$.fragment,e),c(w.$$.fragment,e),c(x.$$.fragment,e),c(E.$$.fragment,e),c(C.$$.fragment,e),c(U.$$.fragment,e),c(z.$$.fragment,e),c(j.$$.fragment,e),c(Q.$$.fragment,e),c(J.$$.fragment,e),c(V.$$.fragment,e),c(W.$$.fragment,e),qe=!1},d(e){e&&(n(te),n(K),n(ne),n(ae),n(oe),n(se),n(k),n(ie),n(re),n(y),n(le),n(me),n(ue),n(N),n(pe),n(M),n(he),n($),n(ce),n(A),n(de),n(S),n(_e),n(fe),n(I),n(ge),n(R),n(be),n(O),n(ve),n(L),n(Te),n(P),n(we),n(q),n(ke),n(xe),n(G),n(ye),n(Ee),n(D),n(Ce),n(H),n(Ne),n(B),n(Me),n(F),n($e),n(_),n(Ae),n(Se),n(Z),n(Ue),n(X),n(Ie),n(f),n(Re),n(Oe),n(Le),n(Pe),n(ee)),n(b),d(v,e),d(T,e),d(w,e),d(x,e),d(E,e),d(C,e),d(U,e),d(z,e),d(j,e),d(Q,e),d(J,e),d(V,e),d(W,e)}}}const kt='{"title":"介绍","local":"介绍","sections":[{"title":"设置","local":"设置","sections":[],"depth":2}],"depth":1}';function xt(Ge){return ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $t extends dt{constructor(b){super(),_t(this,b,xt,wt,pt,{})}}export{$t as component};
