optimum-tpu
Google TPU optimizations for transformers models
파일 탐색기
최종 버전 다운로드 (.zip)- check_code_quality.yml
- doc-build.yml
- doc-pr-build.yml
- pypi-release.yaml
- secrets-leak.yml
- test-pytorch-xla-tpu-tgi-integration.yml
- test-pytorch-xla-tpu-tgi-jetstream.yml
- test-pytorch-xla-tpu-tgi-nightly-jetstream.yml
- test-pytorch-xla-tpu-tgi-nightly.yml
- test-pytorch-xla-tpu-tgi.yml
- test-pytorch-xla-tpu.yml
- tpu-tgi-release.yml
- upload_pr_documentation.yml
- pull_request_template.md
- auto-generate-examples.py
- examples_list.yml
- difference_between_jetstream_and_xla.mdx
- tpu_hardware_support.mdx
- advanced-tgi-serving.mdx
- deploy_instance_on_ie.mdx
- gcloud_cli.mdx
- installation_inside_a_container.mdx
- more_examples.mdx
- serving.mdx
- training.mdx
- fsdp_v2.mdx
- tgi_advanced_options.mdx
- inference_on_tpu.mdx
- tpu_setup.mdx
- training_on_tpu.mdx
- _toctree.yml
- contributing.mdx
- index.mdx
- installation.mdx
- optimum_container.mdx
- supported-architectures.mdx
- gemma_tuning.ipynb
- llama_tuning.ipynb
- generation.py
- README.md
- __init__.py
- logits_process.py
- token_selector.py
- __init__.py
- cli.py
- distributed_model.py
- fsdp_v2.py
- jetstream_pt_support.py
- model.py
- modeling.py
- modeling_gemma.py
- modeling_llama.py
- modeling_mistral.py
- static_cache_xla.py
- version.py
- xla_logger.py
- xla_model_parallel.py
- xla_mp_comm.py
- conftest.py
- test_distributed_model.py
- Dockerfile
- entrypoint.sh
- conftest.py
- pytest.ini
- requirements.txt
- test_model.py
- __init__.py
- gemma_model_hf.py
- llama_model_exportable_hf.py
- mixtral_model_hf.py
- __init__.py
- compatibility.py
- engine_loader.py
- generator.py
- logits_process.py
- token_selector.py
- auto_generator.py
- cli.py
- generator.py
- generator_base.py
- interceptor.py
- server.py
- version.py
- build-requirements.txt
- Makefile
- pyproject.toml
- conftest.py
- decode_tests_utils.py
- helpers.py
- pytest.ini
- test_decode.py
- test_decode_jetstream.py
- test_decode_jetstream_quant.py
- test_generator_slot.py
- test_prefill_truncate.py
- test_tinyllama.py
- test_warmup.py
- Cargo.toml
- README.md
- .gitignore
- LICENSE
- Makefile
- MANIFEST.in
- pyproject.toml
- README.md
- requirements.txt
- setup.cfg
# 설치 가이드
1. 코드 내려받기
git clone https://github.com/huggingface/optimum-tpu
깃허브에서 프로젝트 코드 전체를 내 컴퓨터로 내려받습니다.
cd optimum-tpu
방금 내려받은 프로젝트 폴더 안으로 이동합니다.
2. Docker
쉬움 추천사전 준비물
- Git GitHub에서 프로젝트 코드를 내려받으려면 필요합니다.
- Docker Desktop 컨테이너를 빌드하고 실행하려면 필요합니다. 설치 후 실행해서 백그라운드에 켜두세요.
⚠️ 이 프로젝트는 규모가 큰 저장소라, 이 방법이 실제 핵심 제품이 아니라 내부 하위 패키지를 가리키는 것일 수 있습니다. README 전체를 함께 확인해보세요.
docker build -f text-generation-inference/docker/Dockerfile -t optimum-tpu .
Dockerfile을 기반으로 실행 가능한 이미지를 빌드합니다.
docker run -p 8080:80 optimum-tpu
빌드된 이미지를 실제 컨테이너로 실행합니다.
터미널에 docker compose ps 를 입력해 컨테이너들이 Up 상태인지 확인하세요. README에 포트 번호가 적혀있다면 브라우저에서 http://localhost:포트번호 로 접속해보세요.
3. Python
쉬움사전 준비물
pip install -r requirements.txt
requirements.txt 등에 명시된 파이썬 라이브러리를 설치합니다.
jupyter notebook
브라우저에서 노트북(.ipynb) 파일들을 열람하고 실행할 수 있는 Jupyter 화면을 켭니다.
에러 메시지 없이 실행되고 터미널에 안내 문구가 출력되면 정상입니다.
4. Rust
보통사전 준비물
- Git GitHub에서 프로젝트 코드를 내려받으려면 필요합니다.
- Rust (rustup) rustup으로 설치하면 cargo도 함께 설치됩니다.
cd text-generation-inference
이 프로젝트의 관련 파일이 하위 폴더 안에 있어서, 먼저 그 폴더로 이동합니다.
cargo build --release
Rust 프로젝트를 컴파일합니다.
cargo run
빌드 후 바로 실행까지 진행합니다.
cargo build가 에러 없이 끝나면 성공입니다. target/ 폴더에 실행 파일이 생성됩니다.
5. Make
보통사전 준비물
- Git GitHub에서 프로젝트 코드를 내려받으려면 필요합니다.
- Make Linux/macOS는 보통 기본 설치되어 있습니다. Windows는 별도 설치(예: MSYS2, WSL)가 필요합니다.
make
생성된 빌드 설정을 바탕으로 실제 컴파일을 진행해 실행 파일을 만듭니다.
에러 없이 끝나면 성공입니다. 생성된 실행 파일을 직접 실행해보세요.
// repository documentation
Was this content helpful?
(0 ratings)
