Run this model with HF Jobs

Run facebook/KernelLLM on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/facebook/KernelLLM. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs and Transformers to run batch inference with https://huggingface.co/facebook/KernelLLM on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs and Lighteval to evaluate https://huggingface.co/facebook/KernelLLM. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/facebook/KernelLLM with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
marksaroufim commited on
Commit
3c9bd97
·
verified ·
1 Parent(s): 8064ae2

Fix generated response text

Browse files

join="" does not exist for python 3.10

And a regular print was printing text with jumbled \n

This PR instead just make the code look nice

```python
import torch
import torch.nn as nn
import torch.nn.functional as F


class Model(nn.Module):
def __init__(self) -> None:
super().__init__()

def forward(self, a, b):
return a + b


def get_inputs():
# randomly generate input tensors based on the model architecture
a = torch.randn(1, 128).cuda()
b = torch.randn(1, 128).cuda()
return [a, b]


def get_init_inputs():
# randomly generate tensors required for initialization based on the model architecture
return []

```
The example new arch with custom Triton kernels looks like this:
```
import torch
import torch.nn as nn
import torch.nn.functional as F
import triton
import triton.language as tl


@triton .jit
def add_kernel(
x_ptr, # Pointer to first input
y_ptr, # Pointer to second input
out_ptr,
```

1 file changed +1 -1
README.md+1-1