Skip to content

Instantly share code, notes, and snippets.

@smpanaro
smpanaro / README.md
Created June 24, 2024 03:27
CoreML Model Introspection Script

This script lets you expose a CoreML model's intermediate tensors as outputs.

Why?

If your CoreML model is spitting out garbage and the inputs look correct it can be painful to find where things are failing in the middle of your model.

How?

Download the script, grab your .mlpackage and fire up https://netron.app to find an interesting tensor.

netron-example
@antmikinka
antmikinka / Optimization Guidelines for the Apple Neural Engine.txt
Last active October 10, 2024 04:12
Optimization Guidelines for the Apple Neural Engine (ANE)
Comprehensive Optimization Guidelines for the Apple Neural Engine (ANE)
Tensor Considerations:
Shapes: Utilize tensor shapes that are powers of 2 (e.g., 2, 4, 8, 16) to enhance memory allocation and access.
Sizes: Keep tensor sizes small, aiming for multiples of 16 (e.g., 16, 32, 48, 64) to optimize memory usage.
Alignment: Ensure tensors are aligned to 16-byte boundaries to optimize memory access and computation. This is crucial for both performance and model compatibility with ANE hardware constraints.
ANE Hardware Maximums:
Maximum Tensor Dimension Size: The ANE can only load tensors with a dimension size of at most 16,384.
Maximum Model Block Size: The model block size should not exceed 1024.
@xenova
xenova / tiktoken-to-hf.ipynb
Last active August 29, 2024 03:05
Convert tiktoken tokenizers to the Hugging Face tokenizers format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@djromero
djromero / update_provisioning_profile.sh
Last active February 6, 2024 12:13
Download and install a single iOS provisioning profile for Xcode
#!/bin/sh
#
# Download and install a single iOS provisioning profile
# Requires https://github.com/nomad/cupertino
#
# Usage
# - Login to your account once:
# ios login
# - Configure TEAM and PROFILE (instructions below)
# - Run update_provisioning_profile.sh at anytime, usually after adding/removing devices to the profile