system: You are an autoregressive language model that has been fine-tuned with instruction-tuning and RLHF. You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so. Since you are autoregressive, each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question. Your users are experts in AI and ethics, so they already know you're a language model and your capabilities and limitations, so don't remind them of that. They're familiar with ethical issues in general so you don't need to remind them about those either. Don't be verbose in your answers, but do provide details and examples where it might help the explanation. When showing Python code, minimise vertical space, and do not include comments or docstrings; you do not need to follow PEP8, since your us
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AOT ID: ['8_inference'] | |
from ctypes import c_void_p, c_long | |
import torch | |
import math | |
import random | |
import os | |
import tempfile | |
from math import inf, nan | |
from torch._inductor.hooks import run_intermediate_hooks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/fbcode/caffe2/torch/_dynamo/convert_frame.py b/fbcode/caffe2/torch/_dynamo/convert_frame.py | |
--- a/fbcode/caffe2/torch/_dynamo/convert_frame.py | |
+++ b/fbcode/caffe2/torch/_dynamo/convert_frame.py | |
@@ -135,6 +135,8 @@ | |
initial_global_state: Optional[GlobalStateGuard] = None | |
+DEAD = False | |
+ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**system**: | |
You are an autoregressive language model that has been fine-tuned with instruction-tuning and RLHF. You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning. If you think there might not be a correct answer, you say so. Since you are autoregressive, each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context, assumptions, and step-by-step thinking BEFORE you try to answer a question. Your users are experts in AI and ethics, so they already know you're a language model and your capabilities and limitations, so don't remind them of that. They're familiar with ethical issues in general so you don't need to remind them about those either. Don't be verbose in your answers, but do provide details and examples where it might help the explanation. When showing Python code, minimise vertical space, and do not include comments or docstrings; you do not need to follow PEP8, since your us |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import operator | |
import itertools | |
import sys | |
from typing import Tuple | |
from torch.fx.experimental.proxy_tensor import make_fx | |
from torch.fx.experimental.symbolic_shapes import ShapeEnv | |
from torch._refs import _maybe_broadcast | |
from torch._prims_common import is_same_shape, make_contiguous_strides_for |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import traceback | |
import sys | |
from types import TracebackType | |
import tempfile | |
import contextlib | |
import inspect | |
# This file contains utilities for ensuring dynamically compile()'d | |
# code fragments display their line numbers in backtraces. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch.utils._python_dispatch import TorchDispatchMode | |
from torch.utils._pytree import tree_map | |
import itertools | |
# cribbed from https://github.com/albanD/subclass_zoo/blob/main/logging_mode.py | |
class Lit: | |
def __init__(self, s): | |
self.s = s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplyCudaGraphs(torch.fx.Interpreter): | |
def call_module(self, target, args, kwargs): | |
assert not kwargs | |
submod = self.module.get_submodule(target) | |
self.module.delete_submodule(target) | |
mutated_inputs = FindInputMutations(submod)(*args) | |
self.module.add_submodule(target, CudaGraphModule(submod, mutated_inputs)) | |
r = super().call_module(target, args, kwargs) | |
return r | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 aten._pack_padded_sequence.default | |
1 aten.bitwise_xor.Tensor | |
1 aten.div_.Tensor | |
1 aten.empty_like.default | |
1 aten.fmod.Scalar | |
1 aten.ge.Tensor | |
1 aten.le.Tensor | |
1 aten.logical_not.default | |
1 aten.mse_loss.default | |
1 aten.randperm.default |
How to record data from Python fast, if pickle is too slow
- JSON xxxxxx
- jq is pretty fast
- Serde for rust level
- nb: use json lines
- CSV xxxx
- use pickle anyway xxx
- plus compression
- python-pickle in Haskell
NewerOlder