Skip to content

Commit 37fa7e9

Browse files
authored
Revert "update editorconfig, enforce via CI (tinygrad#1343)" (tinygrad#1380)
This reverts commit da2efec.
1 parent da2efec commit 37fa7e9

23 files changed

+158
-182
lines changed

.editorconfig

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
# Top-most EditorConfig file
2-
root = true
3-
4-
# Unix-style newlines with a newline ending every file, utf-8 charset
5-
[*]
6-
end_of_line = lf
7-
trim_trailing_whitespace = true
8-
charset = utf-8
9-
1+
# 2 space indentation
102
[*.py]
113
indent_style = space
12-
13-
# ignore binary files
14-
[{*.hwx,*.mlmodel,*.weights,*.golden}]
15-
end_of_line = unset
16-
trim_trailing_whitespace = unset
4+
indent_size = 2

.github/workflows/editorconfig.yml

-13
This file was deleted.

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ jobs:
249249
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
250250
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
251251
sudo apt update && \
252-
sudo apt install -y intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl
252+
sudo apt install -y intel-oneapi-runtime-compilers intel-oneapi-runtime-opencl
253253
- name: Install packages (cuda)
254254
if: matrix.backend == 'cuda'
255255
run: |

examples/webgpu/compile_webgpu.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
model.load_from_pretrained()
1010
run, special_names = jit_model(model, Tensor.randn(1,3,224,224))
1111
functions, statements, bufs, _bufs_to_save = compile_net(run, special_names)
12-
12+
1313
state = get_state_dict(model)
1414
weights = {id(x.lazydata.realized): name for name, x in state.items()}
1515
safe_save(state, path.join(path.dirname(__file__), "net.safetensors"))
@@ -28,7 +28,7 @@
2828
const getTensorBuffer = (safetensorBuffer, tensorMetadata) => {{
2929
return safetensorBuffer.subarray(...tensorMetadata.data_offsets);
3030
}}
31-
31+
3232
const createEmptyBuf = (device, size) => {{
3333
return device.createBuffer({{size, usage: GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_SRC | GPUBufferUsage.COPY_DST }});
3434
}};
@@ -50,7 +50,7 @@
5050
}};
5151
5252
{kernel_code}
53-
53+
5454
const setupNet = async (device, safetensor) => {{
5555
const metadata = getTensorMetadata(safetensor);
5656

examples/webgpu/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ <h1>WebGPU <a href="https://github.com/geohot/tinygrad">tinygrad</a> EfficientNe
5656
console.log(`${delta} ms ${label}`);
5757
document.getElementById('time').innerHTML = `${delta} ms ${label}`;
5858
return out;
59-
}
59+
}
6060

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

@@ -80,7 +80,7 @@ <h1>WebGPU <a href="https://github.com/geohot/tinygrad">tinygrad</a> EfficientNe
8080
const response = await fetch(resource)
8181
if (!response.ok) error("sir. that is not a good URL. try a new one");
8282
document.getElementById("imagebox").src = resource
83-
83+
8484
const img = new Image();
8585
img.crossOrigin = "Anonymous";
8686
img.onload = () => {

extra/accel/ane/2_compile/compile.mm

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main(int argc, char* argv[]) {
3636
CFTypeRef ivalues[2];
3737
ivalues[0] = CFStringCreateWithCString(kCFAllocatorDefault, argv[1], kCFStringEncodingUTF8);
3838
ivalues[1] = CFSTR("./");
39-
39+
4040
CFDictionaryRef iDictionary = CFDictionaryCreate(kCFAllocatorDefault, ikeys, ivalues, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
4141
CFArrayRef array = CFArrayCreate(kCFAllocatorDefault, (const void**)&iDictionary, 1, &kCFTypeArrayCallBacks);
4242

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

72+
7273
return ret;
7374
}

extra/accel/ane/3_run/h11ane.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ namespace H11ANE {
142142
int ANE_ForgetFirmware();
143143

144144

145-
private: // size is 0x88
145+
private: // size is 0x88
146146
unsigned char unknown[0x88];
147147
};
148148

extra/accel/ane/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ Sadly disabling amfi breaks things like vscode. You can runtime patch
5252
```
5353
# MacOS 12.4
5454
55-
smol :: ~/fun/tinygrad » sha1sum /usr/libexec/amfid
55+
smol :: ~/fun/tinygrad » sha1sum /usr/libexec/amfid
5656
0f7e7f7e41408f83d7ebc7564a3828f41cb2ab58 /usr/libexec/amfid
5757
5858
# with patching +0x8e38
5959
6060
(lldb) image list
61-
[ 0] 04B6DF6C-6068-3F18-81A7-978985574387 0x0000000102ad0000 /usr/libexec/amfid
61+
[ 0] 04B6DF6C-6068-3F18-81A7-978985574387 0x0000000102ad0000 /usr/libexec/amfid
6262
(lldb) p *(unsigned int *)0x102ad8e38=0xd2800000
6363
```
6464

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

6969
```
70-
# install xcode and
70+
# install xcode and
7171
sudo xcode-select --switch /Applications/Xcode.app
7272
# xcode also contains ANEServices.tbd
7373
brew install keith/formulae/dyld-shared-cache-extractor
@@ -87,7 +87,7 @@ https://github.com/antgroup-arclab/ANETools.git
8787
* frame #0: 0x00000001c250fecc AppleNeuralEngine`-[_ANEDaemonConnection loadModel:sandboxExtension:options:qos:withReply:]
8888
(lldb) po $x2
8989
_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={
90-
} : perfStatsMask=0}
90+
} : perfStatsMask=0}
9191
```
9292

9393
## Choices

extra/accel/ane/README.old

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ rbreak ^ZinAneInstruction*
7979
weeee ZinIrRegBitPrintOutDebug_7u_
8080
print (void)debugregs(0, 0x0000000100211030+8, 3)
8181

82-
== min.plist ==
82+
== min.plist ==
8383

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

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

325325
param_1:
326-
{
326+
{
327327
InputNetworks = (
328328
{
329329
NetworkPlistName = "net.plist";

0 commit comments

Comments
 (0)