Welcome to your comprehensive guide on utilizing the SHARK (High Performance Machine Learning Distribution) framework! This article walks you through installation, usage, and troubleshooting tips to help you harness the full power of SHARK for your machine learning needs.
What is SHARK?
SHARK is a cutting-edge machine learning distribution designed to leverage high performance for various applications. It is currently being rebuilt to take advantage of [Turbine](https://github.com/nod-ai/SHARK-Turbine); until this is completed, it’s advisable to use the .exe release or a checkout of the SHARK-1.0 branch for a stable experience.
Prerequisites: Hardware Drivers
- Windows Users: Install your respective drivers from the following links:
- AMD RDNA: [Download latest driver](https://www.amd.com/en/support)
- Nvidia: [Download CUDA/Vulkan drivers](https://developer.nvidia.com/cuda-downloads)
- macOS: [Download 1.3.216 Vulkan SDK](https://sdk.lunarg.com/sdk/download/1.3.216.0/mac/vulkan-sdk-macos-1.3.216.0.dmg)
- Linux Users: Install the latest AMGPU-PRO drivers or NVidia Linux Drivers. Ensure you have your vendor drivers and Vulkan SDK from [here](https://vulkan.lunarg.com/sdk/home).
Quick Start for SHARK on Windows 10/11
- Install your drivers as per the above prerequisites.
- Download the [stable release](https://github.com/nod-ai/shark/releases/latest) or the most recent [SHARK 1.0 pre-release](https://github.com/nod-ai/shark/releases).
- Double-click the .exe file or run from the command line (recommended) to launch the SHARK UI.
- If you have custom models, place them in the models directory where the .exe is located.
- Enjoy!
More Installation Notes
- It’s recommended to download each .exe in a new folder. If installing a new version in the same location, delete old *.vmfb files.
- If you updated the driver or binary, clear all local artifacts with the –clear_all flag to prevent conflicts.
Running SHARK
To run SHARK, open a Command Prompt or PowerShell terminal, navigate (cd) to the folder containing the .exe, and execute it. If any errors occur, copy and paste the output to seek help. Typically, the first run takes a while to download and compile models, so patience is key!
Stopping SHARK
To stop the application, select the command prompt running the .exe and press CTRL-C, or close the terminal.
Advanced Installation for Developers
If you’re a developer, follow these steps:
- Install Git for Windows from here.
- Clone the repository using the command:
- Set up your Python virtual environment and dependencies per your operating system’s instructions.
git clone https://github.com/nod-ai/SHARK.git
cd SHARK
git checkout SHARK-1.0
Benchmarking and API References
Run benchmarks on individual dispatches by appending –dispatch_benchmarks=All –dispatch_benchmarks_dir=output_dir to your pytest command line arguments. The SHARK Inference API allows the import of mlir files with ease. Here’s an example:
from shark.shark_importer import SharkImporter
mlir_importer = SharkImporter(torch_module, (input), frontend=torch)
torch_mlir, func_name = mlir_importer.import_mlir(tracing_required=True)
Troubleshooting
If you encounter any issues during installation or execution, here are some steps you can take:
- Make sure your drivers are up to date as specified in the prerequisites.
- Clear any old files if you updated your .exe or drivers.
- Check for compatibility issues by confirming you’re on the SHARK-1.0 branch.
- If you continue to experience problems, you can seek support from the SHARK Discord server.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
Happy coding and may your SHARK experience be seamless and productive!