Skip to content

Instantly share code, notes, and snippets.

asmeurer / ndindex_pyinstrument1.html
Last active July 17, 2024 18:49
ndindex pyinstrument profiles
<!DOCTYPE html>
<meta charset="utf-8">
<div id="app"></div>
<script>var pyinstrumentHTMLRenderer=function(){"use strict";var ct=Object.defineProperty;var dt=(R,C,H)=>C in R?ct(R,C,{enumerable:!0,configurable:!0,writable:!0,value:H}):R[C]=H;var k=(R,C,H)=>(dt(R,typeof C!="symbol"?C+"":C,H),H);const R="";function C(){}function H(t){return t()}function we(){return Object.create(null)}function O(t){t.forEach(H)}function be(t){return typeof t=="function"}function K(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function Ie(t){return Object.keys(t).length===0}function Re(t,...e){if(t==null)return C;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function se(t,e,i){t.$$.on_destroy.push(Re(e,i))}function f(t,e){t.appendChild(e)}function X(t,e,i){t.insertBefore(e,i||null)}function N(t){t.parentNode&&t.parentNode.removeChild(t)}function _(t){return
asmeurer / grammar-checker-gpt-prompt.txt
Last active April 26, 2024 06:25
Grammar Checker GPT Prompt
=========================================================================== test session starts ===========================================================================
platform darwin -- Python 3.11.7, pytest-8.0.0, pluggy-1.4.0
rootdir: /Users/aaronmeurer/Documents/array-api-tests
configfile: pytest.ini
plugins: pudb-0.7.0, hypothesis-6.99.2, json-report-1.5.0, cov-4.1.0, doctestplus-1.1.0, typeguard-4.1.5, flakes-4.0.5
collected 27 items / 26 deselected / 1 selected
array_api_tests/ F [100%]
================================================================================ FAILURES =================================================================================
import torch
from torch.testing import make_tensor
from torch.fx.experimental.proxy_tensor import make_fx
from torch.utils.benchmark import Timer, Compare
from torch._inductor.compile_fx import compile_fx_inner, cudagraphify_impl
from torch._inductor.decomposition import decompositions
from itertools import product
import numpy as np
asmeurer / duplicate negative index handling
Last active November 30, 2023 23:01
take decomposition benchmark
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] Output code:
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG]
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] from ctypes import c_void_p, c_long
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import torch
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import math
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import random
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import os
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] import tempfile
[2023-11-30 15:32:07,909] torch._inductor.graph.__output_code: [DEBUG] from math import inf, nan
asmeurer / sympy-gpt-prompt
Last active January 11, 2024 01:56
SymPy GPT prompt
You are a specialized GPT designed to assist users with the SymPy Python library. Your primary function is to help users understand and utilize SymPy for their mathematical and symbolic computation needs. You are equipped with the ability to execute Python code, particularly focusing on SymPy. Before executing any code, you will always install the latest version of SymPy provided by the user as a wheel file. Additionally, you have access to a PDF of SymPy's documentation, which you can reference to provide accurate and detailed explanations. You are knowledgeable in Python and SymPy, capable of solving a wide range of mathematical problems and offering code examples and explanations. If you are presented with a mathematical question, you should write code using SymPy to solve the problem. If you find that a problem cannot be solved by SymPy, you may suggest alternative Python libraries to solve the problem. Remember that the point is not just to solve people's problems for them, but to teach them how to use
asmeurer /
Created October 23, 2023 21:45
def inner_fn(index):
i0, i1 = index
tmp0 = ops.index_expr(i1, dtype=torch.int64)
tmp1 = ops.to_dtype(tmp0, torch.float32, src_dtype=torch.int64)
tmp2 = ops.constant(225.0, torch.float32)
tmp3 = tmp1 < tmp2
tmp4 = ops.index_expr(i1, dtype=torch.int64)
tmp5 = ops.to_dtype(tmp4, torch.float32, src_dtype=torch.int64)
tmp6 = ops.constant(0.0066815144766146995, torch.float32)
tmp7 = tmp5 * tmp6
^CYou can add @seed(209619979639939998162824709723232908623) to this test or run pytest with --hypothesis-seed=209619979639939998162824709723232908623 to reproduce this failure.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
config = <_pytest.config.Config object at 0x7ff694b54a90>, doit = <function _main at 0x7ff692e01c10>
def wrap_session(
config: Config, doit: Callable[[Config, "Session"], Optional[Union[int, ExitCode]]]
) -> Union[int, ExitCode]:
"""Skeleton command line program."""
>>> import scipy.signal
>>> import cupy
>>> x = cupy.zeros((50_000_000,))
>>> x[10] = 1.
>>> scipy.signal.welch(x)
Traceback (most recent call last):
2023-02-21T22:44:21.0827343Z Draw 1 (x): tensor(184550662, dtype=torch.int32)
2023-02-21T22:44:21.0827853Z Draw 2 (s): 0
2023-02-21T22:44:21.0828094Z Trying example: test_remainder(
2023-02-21T22:44:21.0828325Z data=data(...),
2023-02-21T22:44:21.0828668Z ctx=BinaryParamContext(<__mod__(x, s)>),
2023-02-21T22:44:21.0828929Z )
2023-02-21T22:44:21.0829235Z Draw 1 (x): tensor(-16, dtype=torch.int32)
2023-02-21T22:44:21.0829490Z Draw 2 (s): 74
2023-02-21T22:44:21.3006068Z Fatal Python error: Floating point exception