Skip to content

Commit

Permalink
Revert "update editorconfig, enforce via CI (tinygrad#1343)" (tinygra…
Browse files Browse the repository at this point in the history
…d#1380)

This reverts commit da2efec.
  • Loading branch information
geohot authored Jul 31, 2023
1 parent da2efec commit 37fa7e9
Show file tree
Hide file tree
Showing 23 changed files with 158 additions and 182 deletions.
16 changes: 2 additions & 14 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# Top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file, utf-8 charset
[*]
end_of_line = lf
trim_trailing_whitespace = true
charset = utf-8

# 2 space indentation
[*.py]
indent_style = space

# ignore binary files
[{*.hwx,*.mlmodel,*.weights,*.golden}]
end_of_line = unset
trim_trailing_whitespace = unset
indent_size = 2
13 changes: 0 additions & 13 deletions .github/workflows/editorconfig.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ jobs:
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update && \
sudo apt install -y intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl
sudo apt install -y intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl
- name: Install packages (cuda)
if: matrix.backend == 'cuda'
run: |
Expand Down
6 changes: 3 additions & 3 deletions examples/webgpu/compile_webgpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
model.load_from_pretrained()
run, special_names = jit_model(model, Tensor.randn(1,3,224,224))
functions, statements, bufs, _bufs_to_save = compile_net(run, special_names)

state = get_state_dict(model)
weights = {id(x.lazydata.realized): name for name, x in state.items()}
safe_save(state, path.join(path.dirname(__file__), "net.safetensors"))
Expand All @@ -28,7 +28,7 @@
const getTensorBuffer = (safetensorBuffer, tensorMetadata) => {{
return safetensorBuffer.subarray(...tensorMetadata.data_offsets);
}}
const createEmptyBuf = (device, size) => {{
return device.createBuffer({{size, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST }});
}};
Expand All @@ -50,7 +50,7 @@
}};
{kernel_code}
const setupNet = async (device, safetensor) => {{
const metadata = getTensorMetadata(safetensor);
Expand Down
4 changes: 2 additions & 2 deletions examples/webgpu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h1>WebGPU <a href="https://github.com/geohot/tinygrad">tinygrad</a> EfficientNe
console.log(`${delta} ms ${label}`);
document.getElementById('time').innerHTML = `${delta} ms ${label}`;
return out;
}
}

const getLabels = async () => (await fetch("https://raw.githubusercontent.com/anishathalye/imagenet-simple-labels/master/imagenet-simple-labels.json")).json();

Expand All @@ -80,7 +80,7 @@ <h1>WebGPU <a href="https://github.com/geohot/tinygrad">tinygrad</a> EfficientNe
const response = await fetch(resource)
if (!response.ok) error("sir. that is not a good URL. try a new one");
document.getElementById("imagebox").src = resource

const img = new Image();
img.crossOrigin = "Anonymous";
img.onload = () => {
Expand Down
3 changes: 2 additions & 1 deletion extra/accel/ane/2_compile/compile.mm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
CFTypeRef ivalues[2];
ivalues[0] = CFStringCreateWithCString(kCFAllocatorDefault, argv[1], kCFStringEncodingUTF8);
ivalues[1] = CFSTR("./");

CFDictionaryRef iDictionary = CFDictionaryCreate(kCFAllocatorDefault, ikeys, ivalues, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFArrayRef array = CFArrayCreate(kCFAllocatorDefault, (const void**)&iDictionary, 1, &kCFTypeArrayCallBacks);

Expand Down Expand Up @@ -69,5 +69,6 @@ int main(int argc, char* argv[]) {
int ret = ANECCompile(optionsDictionary, flagsDictionary, 0);
printf("compile: %d\n", ret);


return ret;
}
2 changes: 1 addition & 1 deletion extra/accel/ane/3_run/h11ane.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ namespace H11ANE {
int ANE_ForgetFirmware();


private: // size is 0x88
private: // size is 0x88
unsigned char unknown[0x88];
};

Expand Down
8 changes: 4 additions & 4 deletions extra/accel/ane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Sadly disabling amfi breaks things like vscode. You can runtime patch
```
# MacOS 12.4
smol :: ~/fun/tinygrad » sha1sum /usr/libexec/amfid
smol :: ~/fun/tinygrad » sha1sum /usr/libexec/amfid
0f7e7f7e41408f83d7ebc7564a3828f41cb2ab58 /usr/libexec/amfid
# with patching +0x8e38
(lldb) image list
[ 0] 04B6DF6C-6068-3F18-81A7-978985574387 0x0000000102ad0000 /usr/libexec/amfid
[ 0] 04B6DF6C-6068-3F18-81A7-978985574387 0x0000000102ad0000 /usr/libexec/amfid
(lldb) p *(unsigned int *)0x102ad8e38=0xd2800000
```

Expand All @@ -67,7 +67,7 @@ This disables the entitlement check, then you don't need a bootarg. I wish Apple
## Extracting ANEServices.framework

```
# install xcode and
# install xcode and
sudo xcode-select --switch /Applications/Xcode.app
# xcode also contains ANEServices.tbd
brew install keith/formulae/dyld-shared-cache-extractor
Expand All @@ -87,7 +87,7 @@ https://github.com/antgroup-arclab/ANETools.git
* frame #0: 0x00000001c250fecc AppleNeuralEngine`-[_ANEDaemonConnection loadModel:sandboxExtension:options:qos:withReply:]
(lldb) po $x2
_ANEModel: { modelURL=file:///var/folders/l8/38vj8bm52_gfgsqgdn__sh2w0000gn/T/test_F48D9B88-A68D-476F-ADC8-32BDAF9A2498.mlmodelc/ : key={"isegment":0,"inputs":{"image":{"shape":[1,1,1,64,1]},"image2":{"shape":[1,1,1,64,1]}},"outputs":{"probs":{"shape":[1,1,1,64,1]}}} : string_id=0x00000000 : program=(null) : state=1 : programHandle=0 : intermediateBufferHandle=0 : queueDepth=0 : attr={
} : perfStatsMask=0}
} : perfStatsMask=0}
```

## Choices
Expand Down
4 changes: 2 additions & 2 deletions extra/accel/ane/README.old
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ rbreak ^ZinAneInstruction*
weeee ZinIrRegBitPrintOutDebug_7u_
print (void)debugregs(0, 0x0000000100211030+8, 3)

== min.plist ==
== min.plist ==

Types: GOC, Conv, Broadcast, ScaledElementWise, Reshape, InputView, Neuron, Concat

Expand Down Expand Up @@ -323,7 +323,7 @@ zin_ane_compiler v4.2.1
ANECCompile(__CFDictionary *param_1, __CFDictionary *param_2, unsigned long param_3)

param_1:
{
{
InputNetworks = (
{
NetworkPlistName = "net.plist";
Expand Down
Loading

0 comments on commit 37fa7e9

Please sign in to comment.