Run this model with HF Jobs

Run deepseek-ai/DeepSeek-R1 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/deepseek-ai/DeepSeek-R1. 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/deepseek-ai/DeepSeek-R1 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/deepseek-ai/DeepSeek-R1. 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/deepseek-ai/DeepSeek-R1 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.

[Bug] assert not self.training

#136
by Gaie - opened
    def forward(self, hidden_states):
        bsz, seq_len, h = hidden_states.shape
        ### compute gating score
        hidden_states = hidden_states.view(-1, h)
        logits = F.linear(
            hidden_states.type(torch.float32), self.weight.type(torch.float32), None
        )
        if self.scoring_func == "sigmoid":
            scores = logits.sigmoid()
        else:
            raise NotImplementedError(
                f"insupportable scoring function for MoE gating: {self.scoring_func}"
            )

        ### select top-k experts
        if self.topk_method == "noaux_tc":
            assert not self.training
            scores_for_choice = scores.view(bsz * seq_len, -1) + self.e_score_correction_bias.unsqueeze(0)
            group_scores = (
                scores_for_choice.view(bsz * seq_len, self.n_group, -1).topk(2, dim=-1)[0].sum(dim = -1)

Thank you for open-sourcing this model. During my local fine-tuning, I encountered an assertion error in the MoEGate class, which seems to indicate that the model currently does not allow users to train it. Could you please provide a forward function suitable for training? Thank you again for your efforts.

I'm actually seeing the same error when trying to fine-tune Deepseek-R1 across a cluster, using Deepspeed zero3. It loads the model fine and, but it fails just before the training starts. Would be grateful for a solution! Thanks!

The same issue persists. Eagerly anticipating a resolution.

mark

any fix for this please..

Sign up or log in to comment