{"id":6987,"date":"2024-07-26T15:11:23","date_gmt":"2024-07-26T06:11:23","guid":{"rendered":"https:\/\/highreso.jp\/edgehub\/?p=6987"},"modified":"2024-07-26T15:11:24","modified_gmt":"2024-07-26T06:11:24","slug":"vllmtoha","status":"publish","type":"post","link":"https:\/\/highreso.jp\/edgehub\/machinelearning\/vllmtoha.html","title":{"rendered":"vLLM\u306e\u4f7f\u3044\u65b9\uff01LLM\u3092\u30ed\u30fc\u30ab\u30eb\u3067\u9ad8\u901f\u306b\u52d5\u304b\u3059"},"content":{"rendered":"\n<p>vLLM\u306f\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067LLM\u304c\u4f7f\u3048\u308b\u7121\u6599\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">vLLM\u3092\u4f7f\u3048\u3070\u3001LLM\u306b\u3088\u308b\u30c6\u30ad\u30b9\u30c8\u751f\u6210\u3092\u9ad8\u901f\u306b\u884c\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001vLLM\u306e\u74b0\u5883\u69cb\u7bc9\u304b\u3089\u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u751f\u6210\u306e\u65b9\u6cd5\u307e\u3067\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">vLLM\u3068\u306f<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/chameleon_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-6269\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/chameleon_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/chameleon_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>vLLM\u306f\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067LLM\u304c\u4f7f\u3048\u308b\u7121\u6599\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">vLLM\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001LLM\u306b\u3088\u308b\u30c6\u30ad\u30b9\u30c8\u751f\u6210\u3092\u9ad8\u901f\u306b\u884c\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<p>vLLM\u3067\u306fHuggingFace\u3067\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u30e2\u30c7\u30eb\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u3001\u91cf\u5b50\u5316\u30e2\u30c7\u30eb\u3082\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"p-blogParts post_content\" data-partsID=\"4485\"><p><div class=\"p-adBox -ranking -border-on\" data-id=\"4507\" data-ad=\"ranking\"><div class=\"p-adBox__title -rank1\">1\u6642\u959350\u5186\u304b\u3089\u4f7f\u3048\u308bGPU\u30af\u30e9\u30a6\u30c9\u300cGPUSOROBAN\u300d<\/div><div class=\"p-adBox__body\"><div class=\"p-adBox__img\"><div class=\"centerw250\"><a href=\"https:\/\/soroban.highreso.jp\/?utm_medium=edgehub&utm_source=edgehub&utm_campaign=highend-boxtop&adid=edgehub\" rel=\"nofollow\" referrerpolicy=\"no-referrer-when-downgrade\"><img decoding=\"async\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/gpusorobanlllm_banner.jpg\" alt=\"GPUSOROBAN\"><\/a><\/div><\/div><div class=\"p-adBox__details\"><div class=\"p-adBox__star c-reviewStars\"><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><i class=\"icon-star-full\"><\/i><\/div><div class=\"p-adBox__price u-thin u-fz-s\">GPU\u306e\u30b3\u30b9\u30c8\u3067\u304a\u60a9\u307f\u306e\u65b9\u306b\uff01<\/div><div class=\"p-adBox__desc\">\u751f\u6210AI\u30fbLLM\u5411\u3051\u306e\u9ad8\u901fGPU\u3092\u696d\u754c\u6700\u5b89\u7d1a\u306e1\u6642\u959350\u5186\u304b\u3089\u5229\u7528\u3067\u304d\u307e\u3059\u3002\r\n\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u74b0\u5883\u3055\u3048\u3042\u308c\u3070\u3001GPU\u30b5\u30fc\u30d0\u30fc\u3092\u3059\u3050\u306b\u4f7f\u3048\u307e\u3059\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8d77\u52d5\u3057\u3066\u3044\u308b\u3068\u304d\u306e\u307f\u306e\u8ab2\u91d1\u3067\u3001\u30b3\u30b9\u30c8\u3092\u6700\u5c0f\u5316\u3067\u304d\u307e\u3059\u3002\r\n<\/div><\/div><\/div><div class=\"p-adBox__btns\"><a href=\"https:\/\/soroban.highreso.jp\/compute\/?utm_medium=edgehub&utm_source=edgehub&utm_campaign=boxtop&adid=edgehub\" class=\"p-adBox__btn -btn1\" target=\"_blank\" rel=\"noopener nofollow\">\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u898b\u308b<\/a><a href=\"https:\/\/soroban.highreso.jp\/download\/compute-catalog\/?utm_medium=edgehub&utm_source=edgehub&utm_campaign=boxtop&adid=edgehub\" class=\"p-adBox__btn -btn2\" target=\"_blank\" rel=\"noopener nofollow\">\u8cc7\u6599\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/a><\/div><\/div><\/p>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">vLLM\u306e\u5b9f\u884c\u74b0\u5883<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/bluewave_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-6274\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/bluewave_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/bluewave_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">LLM\u306e\u30e2\u30c7\u30eb\u3092\u4f7f\u3046\u969b\u306b\u3001GPU\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306aGPU\u3092\u642d\u8f09\u3057\u305f\u74b0\u5883\u3092\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-group is-style-big_icon_good\"><div class=\"wp-block-group__inner-container\">\n<ul class=\"wp-block-list\">\n<li>GPU\uff1aNVIDIA A100<\/li>\n\n\n\n<li>GPU\u30e1\u30e2\u30ea\uff08VRAM\uff1a80GB\uff09<\/li>\n\n\n\n<li>OS\uff1aUbuntu 22.04LTS<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p>Windows\u3092\u304a\u4f7f\u3044\u306e\u65b9\u306f\u3001Ubuntu\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/windowsubuntu-eyecatch-300x158.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/highreso.jp\/edgehub\/machinelearning\/windowsubuntu.html\">Windows\u306bUbuntu\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff01WSL\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306b\u69cb\u7bc9<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Windows\u306bUbuntu\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u3002 Windows\u306b\u6a19\u6e96\u642d\u8f09\u3055\u308c\u3066\u3044\u308bWSL\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001Ubuntu\u3092\u7c21\u5358\u306b\u69cb\u7bc9\u3067\u304d\u307e\u3059\u3002 WSL\u30fbUbuntu\u306e&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<h2 class=\"wp-block-heading\">vLLM\u306e\u74b0\u5883\u69cb\u7bc9<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/greencircle_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-6100\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/greencircle_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/greencircle_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Docker\u30b3\u30f3\u30c6\u30ca\u3092\u4f7f\u3063\u3066vLLM\u306e\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<p>Docker\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<div class=\"swell-block-postLink\">\t\t\t<div class=\"p-blogCard -internal\" data-type=\"type1\" data-onclick=\"clickLink\">\n\t\t\t\t<div class=\"p-blogCard__inner\">\n\t\t\t\t\t<span class=\"p-blogCard__caption\">\u3042\u308f\u305b\u3066\u8aad\u307f\u305f\u3044<\/span>\n\t\t\t\t\t<div class=\"p-blogCard__thumb c-postThumb\"><figure class=\"c-postThumb__figure\"><img decoding=\"async\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/ubuntudocker-eyecatch-300x158.jpg\" alt=\"\" class=\"c-postThumb__img u-obf-cover\" width=\"320\" height=\"180\"><\/figure><\/div>\t\t\t\t\t<div class=\"p-blogCard__body\">\n\t\t\t\t\t\t<a class=\"p-blogCard__title\" href=\"https:\/\/highreso.jp\/edgehub\/machinelearning\/ubuntudocker.html\">Ubuntu\u306bDocker\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\uff01GPU\u3092\u30b3\u30f3\u30c6\u30ca\u304b\u3089\u4f7f\u3046\u65b9\u6cd5<\/a>\n\t\t\t\t\t\t<span class=\"p-blogCard__excerpt\">GPU\u306e\u74b0\u5883\u69cb\u7bc9\u3067\u306f\u3001\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u4e0d\u4e00\u81f4\u306b\u3088\u308b\u30a8\u30e9\u30fc\u304c\u983b\u767a\u3057\u307e\u3059\u3002 Docker\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u3053\u306e\u3088\u3046\u306a\u4f9d\u5b58\u95a2\u4fc2\u306e\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u3067&#8230;<\/span>\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t<\/div>\n\n\n<div class=\"swell-block-step\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">Dockerfile\u306e\u4f5c\u6210<\/div><div class=\"swell-block-step__body\">\n<p>CUDA\u3001Python\u3001vllm\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308bDockerfile\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u30d1\u30c3\u30b1\u30fc\u30b8\u4e00\u89a7<\/span><\/div><div class=\"cap_box_content\">\n<ul class=\"wp-block-list\">\n<li>CUDA\uff1a12.1<\/li>\n\n\n\n<li>Python\uff1a3.10<\/li>\n\n\n\n<li>vLLM<\/li>\n\n\n\n<li>JupyterLab<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p>Ubuntu\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u3001Dockerfile\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>mkdir vllm\ncd vllm\nnano Dockerfile<\/code><\/pre>\n\n\n\n<p>Dockerfile\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code># \u30d9\u30fc\u30b9\u30a4\u30e1\u30fc\u30b8(CUDA)\u306e\u6307\u5b9a\nFROM nvidia\/cuda:12.1.0-cudnn8-devel-ubuntu22.04\n\n# \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN apt-get update &amp;&amp; apt-get install -y python3-pip python3-venv git nano\n\n# \u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u8a2d\u5b9a\nWORKDIR \/app\n\n# \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30fc\nCOPY . \/app\n\n# Python\u4eee\u60f3\u74b0\u5883\u306e\u4f5c\u6210\nRUN python3 -m venv \/app\/.venv\n\n# \u4eee\u60f3\u74b0\u5883\u3092\u30a2\u30af\u30c6\u30a3\u30d9\u30fc\u30c8\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092.bashrc\u306b\u8ffd\u52a0\nRUN echo \"source \/app\/.venv\/bin\/activate\" &gt;&gt; \/root\/.bashrc\n\n# JupyterLab\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN \/app\/.venv\/bin\/pip install Jupyter jupyterlab\n\n# vllm\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\nRUN \/app\/.venv\/bin\/pip install vllm\n\n# \u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5\u6642\u306bbash\u3092\u5b9f\u884c\nCMD &#091;\"\/bin\/bash\"]<\/code><\/pre>\n\n\n\n<p class=\"is-style-icon_info\">[Ctrl + S]\u30ad\u30fc\u3067\u5909\u66f4\u5185\u5bb9\u3092\u4fdd\u5b58\u3057\u3001[Ctrl + X]\u30ad\u30fc\u3067\u7de8\u96c6\u30e2\u30fc\u30c9\u304b\u3089\u629c\u3051\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">docker-compose.yml\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/div><div class=\"swell-block-step__body\">\n<p>Docker\u306e\u8a2d\u5b9a\u3092\u3059\u308b\u305f\u3081\u306edocker-compose.yml\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>nano docker-compose.yml<\/code><\/pre>\n\n\n\n<p>\u958b\u3044\u305fdocker-compose.yml\u30d5\u30a1\u30a4\u30eb\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u30b3\u30d4\u30fc\u3057\u3066\u8cbc\u308a\u3064\u3051\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>services:\n  vllm:\n    build:\n      context: .\n      dockerfile: Dockerfile\n    image: vllm\n    runtime: nvidia\n    container_name: vllm\n    ports:\n      - \"8888:8888\"\n    volumes:\n      - .:\/app\/vllm\n    deploy:\n      resources:\n        reservations:\n          devices:\n            - driver: nvidia\n              count: 1\n              capabilities: &#091;gpu]\n    command: &gt;\n      bash -c '\/app\/.venv\/bin\/jupyter lab --ip=\"*\" --port=8888 --NotebookApp.token=\"\" --NotebookApp.password=\"\" --no-browser --allow-root'<\/code><\/pre>\n\n\n\n<p class=\"is-style-icon_info\">[Ctrl + S]\u30ad\u30fc\u3067\u5909\u66f4\u5185\u5bb9\u3092\u4fdd\u5b58\u3057\u3001[Ctrl + X]\u30ad\u30fc\u3067\u7de8\u96c6\u30e2\u30fc\u30c9\u304b\u3089\u629c\u3051\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30b3\u30f3\u30c6\u30ca\u306e\u8d77\u52d5<\/div><div class=\"swell-block-step__body\">\n<p>docker-compose.yml\u306e\u8a18\u8ff0\u3092\u3082\u3068\u306b\u3001Docker\u30b3\u30f3\u30c6\u30ca\u3092\u69cb\u7bc9\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>docker compose up<\/code><\/pre>\n\n\n\n<p>\u30b3\u30f3\u30c6\u30ca\u304c\u8d77\u52d5\u3057\u305f\u3089\u3001\u30ed\u30fc\u30ab\u30ebPC\u306e\u300c\u30d6\u30e9\u30a6\u30b6\u306e\u691c\u7d22\u7a93\u300d\u306b\u4ee5\u4e0b\u306eURL\u3092\u5165\u529b\u3057\u3001Enter\u3092\u62bc\u3059\u3068JupyterLab\u306e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>http:&#47;&#47;localhost:8888\/<\/code><\/pre>\n\n\n\n<p class=\"is-style-icon_info\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30ed\u30fc\u30ab\u30eb\u30dd\u30fc\u30c88888\u3092\u4f7f\u7528\u3057\u3066JupyterLab\u3092\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">vLLM\u306e\u5b9f\u88c5<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/07\/room_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-6936\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/07\/room_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/07\/room_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">Docker\u30b3\u30f3\u30c6\u30ca\u3067\u8d77\u52d5\u3057\u305fJupyter Lab\u4e0a\u3067\u3001vLLM\u306e\u5b9f\u88c5\u3092\u3057\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<div class=\"swell-block-step\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u30a4\u30f3\u30dd\u30fc\u30c8<\/div><div class=\"swell-block-step__body\">\n<p>Jupyter Lab\u306e\u30b3\u30fc\u30c9\u30bb\u30eb\u306b\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>from vllm import LLM, SamplingParams<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number u-bg-main\"><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-l\">\u30e2\u30c7\u30eb\u3068\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u306e\u8a2d\u5b9a<\/div><div class=\"swell-block-step__body\">\n<p>\u30e2\u30c7\u30eb\u3068\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>llm = LLM(\n    model=\"elyza\/Llama-3-ELYZA-JP-8B-AWQ\",\n    quantization=\"awq\"\n)\ntokenizer = llm.get_tokenizer()<\/code><\/pre>\n\n\n\n<div class=\"swell-block-capbox cap_box is-style-onborder_ttl2\" data-colset=\"col3\"><div class=\"cap_box_ttl\"><span>\u30b3\u30fc\u30c9\u306e\u8aac\u660e<\/span><\/div><div class=\"cap_box_content\">\n<p><span class=\"swl-format-2\">model=&#8221;elyza\/Llama-3-ELYZA-JP-8B-AWQ&#8221;<\/span><\/p>\n\n\n\n<p>\u30e2\u30c7\u30eb\u306e\u30bf\u30a4\u30d7\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002vLLM\u3067\u306fHuggingFace\u306e\u30e2\u30c7\u30eb\u304c\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">quantization=&#8221;awq&#8221;<\/span><\/p>\n\n\n\n<p>\u91cf\u5b50\u5316\u306e\u65b9\u5f0f\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><span class=\"swl-format-2\">llm.get_tokenizer()<\/span><\/p>\n\n\n\n<p>\u30c8\u30fc\u30af\u30ca\u30a4\u30b6\u30fc\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<p class=\"is-style-icon_info\">\u30e2\u30c7\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u969b\u306bGPU\u30e1\u30e2\u30ea\u3092\u6d88\u8cbb\u3057\u307e\u3059\u306e\u3067\u3001\u4f59\u88d5\u3092\u6301\u3063\u305fGPU\u30e1\u30e2\u30ea\u3092\u3054\u7528\u610f\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\">vLLM\u3067\u30c6\u30ad\u30b9\u30c8\u751f\u6210<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"300\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/rocklandscape_midashi.jpg\" alt=\"\u898b\u51fa\u3057\u753b\u50cf\" class=\"wp-image-5166\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/rocklandscape_midashi.jpg 600w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/rocklandscape_midashi-300x150.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p><span class=\"swl-format-2\">vLLM\u3092\u4f7f\u3063\u3066\u3001\u65e5\u672c\u8a9e\u3067\u306e\u8cea\u554f\u5fdc\u7b54\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u65e5\u672c\u8a9e\u3067\u306e\u8cea\u554f\u5fdc\u7b54<\/h3>\n\n\n\n<p><span class=\"swl-format-2\">\u300c\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002\u300d\u3068\u3044\u3046\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u65e5\u672c\u8a9e\u3067\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/span><\/p>\n\n\n\n<pre class=\"wp-block-code has-black-background-color has-background\"><code>DEFAULT_SYSTEM_PROMPT = \"\u3042\u306a\u305f\u306f\u65e5\u672c\u4eba\u306e\u30a2\u30b7\u30b9\u30bf\u30f3\u30c8\u3067\u3059\u3002\"\ntext = \"\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002\"\n\nmessages = &#091;\n    {\"role\": \"system\", \"content\": DEFAULT_SYSTEM_PROMPT},\n    {\"role\": \"user\", \"content\": text},\n]\n\nprompt = tokenizer.apply_chat_template(\n    messages,\n    tokenize=False,\n    add_generation_prompt=True\n)\n\nsampling_params = SamplingParams(\n    temperature=0.6,\n    top_p=0.9,\n    max_tokens=1000\n)\n\noutputs = llm.generate(prompt, sampling_params)\n\nprint(output.outputs&#091;0].text)<\/code><\/pre>\n\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-right\" data-col=\"green\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3092\u6559\u3048\u3066\u4e0b\u3055\u3044\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n<div class=\"swell-block-balloon\"><div class=\"c-balloon -bln-left\" data-col=\"gray\"><div class=\"c-balloon__body -speaking -border-none\"><div class=\"c-balloon__text\">\n<p>\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u306f\u3001\u6d77\u306e\u5e78\u3092\u6d3b\u304b\u3057\u305f\u7f8e\u5473\u3057\u3044\u3082\u306e\u304c\u591a\u3044\u3067\u3059\u3002\u4ee5\u4e0b\u306f\u3001\u4ee3\u8868\u7684\u306a\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3067\u3059\u3002<br><br>1. \u52a0\u8cc0\u5c4b\u306e\u30ab\u30ec\u30fc: \u52a0\u8cc0\u5c4b\u306f\u91d1\u6ca2\u5e02\u306e\u8001\u8217\u306e\u30ab\u30ec\u30fc\u5e97\u3067\u3001\u30ab\u30ec\u30fc\u3092\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u3068\u3057\u3066\u63d0\u5531\u3057\u3066\u3044\u307e\u3059\u3002\u72ec\u7279\u306e\u30b9\u30d1\u30a4\u30b9\u306e\u30d6\u30ec\u30f3\u30c9\u3068\u3001\u30b5\u30d5\u30e9\u30f3\u30e9\u30a4\u30b9\u304c\u7279\u5fb4\u3067\u3059\u3002<br><br>2. \u91d1\u6ca2\u30ab\u30ec\u30fc: \u91d1\u6ca2\u30ab\u30ec\u30fc\u306f\u3001\u91d1\u6ca2\u5e02\u306e\u30ab\u30ec\u30fc\u5e97\u304c\u767a\u7965\u3067\u3001\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30ab\u30ec\u30fc\u3068\u3057\u3066\u77e5\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u30eb\u30fc\u306f\u8336\u8272\u304f\u3001\u30b9\u30d1\u30a4\u30b9\u304c\u52b9\u3044\u3066\u3044\u307e\u3059\u3002\u30b5\u30d5\u30e9\u30f3\u30e9\u30a4\u30b9\u3068\u5171\u306b\u63d0\u4f9b\u3055\u308c\u308b\u3053\u3068\u304c\u591a\u304f\u3001\u5177\u306f\u3001\u8c5a\u8089\u3084\u7389\u306d\u304e\u3001\u4eba\u53c2\u3001\u30b8\u30e3\u30ac\u30a4\u30e2\u306a\u3069\u3067\u3059\u3002<br><br>3. \u80fd\u767b\u306e\u306e\u3069\u3050\u308d: \u80fd\u767b\u534a\u5cf6\u306e\u306e\u3069\u3050\u308d\u306f\u3001\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u306e\u4ee3\u8868\u683c\u3067\u3059\u3002\u306e\u3069\u3050\u308d\u306f\u3001\u30bf\u30c4\u30ce\u30aa\u30c8\u30b7\u30b4\u306e\u3053\u3068\u3067\u3059\u3002\u306e\u3069\u3050\u308d\u306f\u3001\u8102\u304c\u306e\u3063\u3066\u3044\u3066\u3001\u8eab\u306f\u767d\u8eab\u3067\u3001\u4e0a\u54c1\u306a\u5473\u3068\u98df\u611f\u3067\u3059\u3002\u5869\u713c\u304d\u3084\u3001\u716e\u4ed8\u3051\u3001\u63da\u3052\u7269\u306a\u3069\u3067\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002<br><br>4. \u52a0\u8cc0\u91ce\u83dc\u306e\u3044\u308d\u3044\u308d: \u77f3\u5ddd\u770c\u306f\u3001\u52a0\u8cc0\u91ce\u83dc\u306e\u751f\u7523\u304c\u76db\u3093\u3067\u3001\u52a0\u8cc0\u91ce\u83dc\u306f\u3001\u77f3\u5ddd\u770c\u306e\u3054\u5f53\u5730\u30b0\u30eb\u30e1\u306e\u539f\u6599\u3068\u3057\u3066\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002\u52a0\u8cc0\u91ce\u83dc\u306f\u3001\u767d\u83dc\u3001\u30ad\u30e3\u30d9\u30c4\u3001\u30d6\u30ed\u30c3\u30b3\u30ea\u30fc\u3001\u30ab\u30ea\u30d5\u30e9\u30ef\u30fc\u3001\u306a\u3069\u304c\u4ee3\u8868\u7684\u3067\u3059\u3002<\/p>\n<span class=\"c-balloon__shapes\"><span class=\"c-balloon__before\"><\/span><span class=\"c-balloon__after\"><\/span><\/span><\/div><\/div><\/div><\/div>\n\n\n<p class=\"is-style-icon_good\">\u7c21\u5358\u306b\u30c6\u30ad\u30b9\u30c8\u751f\u6210\u304c\u3067\u304d\u307e\u3057\u305f\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u751f\u6210AI\u30fbLLM\u306e\u30b3\u30b9\u30c8\u3067\u304a\u56f0\u308a\u306a\u3089<\/h2>\n\n\n\n<p>GPU\u306e\u30b9\u30da\u30c3\u30af\u4e0d\u8db3\u3067\u751f\u6210AI\u306e\u958b\u767a\u304c\u601d\u3046\u3088\u3046\u306b\u9032\u307e\u306a\u3044\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/p>\n\n\n\n<p>\u305d\u3093\u306a\u3068\u304d\u306b\u306f\u3001\u9ad8\u6027\u80fd\u306aGPU\u3092\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306a\u4fa1\u683c\u3067\u4f7f\u3048\u308bGPU\u30af\u30e9\u30a6\u30c9\u30b5\u30fc\u30d3\u30b9\u304c\u304a\u3059\u3059\u3081\u3067\u3059\uff01<\/p>\n\n\n\n<div class=\"p-blogParts post_content\" data-partsID=\"4543\">\n<div class=\"swell-block-capbox cap_box\" data-colset=\"col2\"><div class=\"cap_box_ttl\"><span>GPUSOROBAN<\/span><\/div><div class=\"cap_box_content\">\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1462\" height=\"508\" src=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner.jpg\" alt=\"GPUSOROBAN\" class=\"wp-image-10134\" srcset=\"https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner.jpg 1462w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner-300x104.jpg 300w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner-1024x356.jpg 1024w, https:\/\/highreso.jp\/edgehub\/wp-content\/uploads\/2024\/06\/h100_banner-768x267.jpg 768w\" sizes=\"(max-width: 1462px) 100vw, 1462px\" \/><\/figure>\n\n\n\n<p>GPUSOROBAN\u306f\u3001<span class=\"swl-marker mark_yellow\"><span class=\"swl-format-1\">\u9ad8\u6027\u80fdGPU\u300cNVIDIA H200\u300d\u3092\u696d\u754c\u6700\u5b89\u7d1a\u306e\u6599\u91d1\u3067\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/span><\/p>\n\n\n\n<p>NVIDIA H200\u306f\u3001\u751f\u6210AI\u30fbLLM\u306e\u8a08\u7b97\u306b\u304b\u304b\u308b\u6642\u9593\u3092\u5927\u5e45\u306b\u77ed\u7e2e\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u30af\u30e9\u30a6\u30c9\u3067\u4f7f\u3048\u308b\u305f\u3081\u3001\u5927\u898f\u6a21\u306a\u8a2d\u5099\u6295\u8cc7\u306e\u5fc5\u8981\u304c\u306a\u304f\u3001\u7169\u96d1\u306a\u30b5\u30fc\u30d0\u30fc\u7ba1\u7406\u304b\u3089\u3082\u89e3\u653e\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-columns\"><div class=\"swell-block-columns__inner\">\n<div class=\"swell-block-column swl-has-mb--s\">\n<div class=\"swell-block-button blue_ -size-l is-style-btn_normal\"><a href=\"https:\/\/soroban.highreso.jp\/?utm_medium=edgehub&amp;utm_source=edgehub&amp;utm_campaign=highend_boxb&amp;adid=edgehub\" class=\"swell-block-button__link\"><span>\u516c\u5f0f\u30b5\u30a4\u30c8\u3092\u307f\u308b<\/span><\/a><\/div>\n<\/div>\n\n\n\n<div class=\"swell-block-column swl-has-mb--s\">\n<div class=\"swell-block-button red_ -size-l is-style-btn_normal\"><a href=\"https:\/\/soroban.highreso.jp\/download\/compute-catalog\/?utm_medium=edgehub&amp;utm_source=edgehub&amp;utm_campaign=highend_boxb&amp;adid=edgehub\" class=\"swell-block-button__link\"><span>\u8cc7\u6599\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/span><\/a><\/div>\n<\/div>\n<\/div><\/div>\n<\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>vLLM\u306f\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067LLM\u304c\u4f7f\u3048\u308b\u7121\u6599\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002 vLLM\u3092\u4f7f\u3048\u3070\u3001LLM\u306b\u3088\u308b\u30c6\u30ad\u30b9\u30c8\u751f\u6210\u3092\u9ad8\u901f\u306b\u884c\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001vLLM\u306e\u74b0\u5883\u69cb\u7bc9\u304b\u3089\u30e2\u30c7\u30eb\u3092\u4f7f\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u751f\u6210\u306e\u65b9\u6cd5\u307e\u3067\u7d39\u4ecb\u3057\u307e\u3059\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7030,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[20],"tags":[],"class_list":["post-6987","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machinelearning"],"_links":{"self":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts\/6987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/comments?post=6987"}],"version-history":[{"count":3,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts\/6987\/revisions"}],"predecessor-version":[{"id":8302,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/posts\/6987\/revisions\/8302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/media\/7030"}],"wp:attachment":[{"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/media?parent=6987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/categories?post=6987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/highreso.jp\/edgehub\/wp-json\/wp\/v2\/tags?post=6987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}