Skip to main content

amdshark layers and inference models for genai

Project description

amdshark Tank

WARNING: This is an early preview that is in progress. It is not ready for general use.

Light weight inference optimized layers and models for popular genai applications.

This sub-project is a work in progress. It is intended to be a repository of layers, model recipes, and conversion tools from popular LLM quantization tooling.

Project Status

CI - amdsharktank nightly

Examples

The repository will ultimately grow a curated set of models and tools for constructing them, but for the moment, it largely contains some CLI examples. These are all under active development and should not yet be expected to work.

Perform batched inference in PyTorch on a paged llama derived LLM:

Note: Use --device='cuda:0' to run this inference on an AMD GPU.

python -m amdsharktank.examples.paged_llm_v1 \
  --hf-dataset=open_llama_3b_v2_f16_gguf \
  --device='cuda:0' \
  "Prompt 1" \
  "Prompt 2" ...

Export an IREE compilable batched LLM for serving:

python -m amdsharktank.examples.export_paged_llm_v1 \
  --hf-dataset=open_llama_3b_v2_f16_gguf \
  --output-mlir=/tmp/open_llama_3b_v2_f16.mlir \
  --output-config=/tmp/open_llama_3b_v2_f16.json

Generate sample input tokens for IREE inference/tracy:Add commentMore actions

python -m amdsharktank.examples.paged_llm_v1 \
  --irpa-file=open_llama_3b_v2_f16.irpa \
  --tokenizer-config-json=tokenizer_config.json \
  --prompt-seq-len=128 \
  --bs=4 \
  --dump-decode-steps=1 \
  --max-decode-steps=1 \
  --dump-path='/tmp' \
  --device='cuda:0'

Dump parsed information about a model from a gguf file:

python -m amdsharktank.tools.dump_gguf --hf-dataset=open_llama_3b_v2_f16_gguf

Package Python Release Builds

  • To build wheels for Linux:

    ./build_tools/build_linux_package.sh
    

    That should produce build_tools/wheelhouse/amdsharktank-{X.Y.Z}.dev0-py3-none-any.whl, which can then be installed with

    python3 -m pip install build_tools/wheelhouse/amdsharktank-{X.Y.Z}.dev0-py3-none-any.whl
    
  • To build a wheel for your host OS/arch manually:

    # Build amdsharktank.*.whl into the dist/ directory
    #   e.g. `amdsharktank-3.0.0.dev0-py3-none-any.whl`
    python3 -m pip wheel -v -w dist .
    
    # Install the built wheel.
    python3 -m pip install dist/*.whl
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amdsharktank-3.9.0-py3-none-any.whl (483.6 kB view details)

Uploaded Python 3

File details

Details for the file amdsharktank-3.9.0-py3-none-any.whl.

File metadata

  • Download URL: amdsharktank-3.9.0-py3-none-any.whl
  • Upload date:
  • Size: 483.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for amdsharktank-3.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 605fe4f2b51a0220ca1698aae8d215e9b00f7a637ce87c3ce14d6d20e3ffe43e
MD5 19262dbf8ec26fd07ca3be5206db8186
BLAKE2b-256 112cc4186a678c78a0cba83377068fb17708c228070df5a8d59a8382e97178a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page