helloadhavan/github_issues huggingface dataset:
Repository: ggml-org/llama.cpp
Pull request: cuda : add set rows for bf16

Not sure why this was omitted?

Changed files:
filename: ggml/src/ggml-cuda/ggml-cuda.cu
patch: @@ -3226,8 +3226,8 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
             } break;
         case GGML_OP_SET_ROWS:
             {
-#pragma message("TODO: implement BF16, Q4_0, Q4_1, Q5_0, Q5_1, Q8_0, IQ4_NL support (https://github.com/ggml-org/llama.cpp/pull/14661)")
-                return (op->type == GGML_TYPE_F32 || op->type == GGML_TYPE_F16) &&
+#pragma message("TODO: implement Q4_0, Q4_1, Q5_0, Q5_1, Q8_0, IQ4_NL support (https://github.com/ggml-org/llama.cpp/pull/14661)")
+                return (op->type == GGML_TYPE_F32 || op->type == GGML_TYPE_F16 || op->type == GGML_TYPE_BF16) &&
                        op->src[0]->type == GGML_TYPE_F32 &&
                        op->src[1]->type == GGML_TYPE_I64;
             } break;

filename: ggml/src/ggml-cuda/set-rows.cu
patch: @@ -10,6 +10,11 @@ __device__ __forceinline__ void set_rows_1<float, half>(const float * src_f, hal
     *dst_h = __float2half(*src_f);
 }
 
+template<>
+__device__ __forceinline__ void set_rows_1<float, nv_bfloat16>(const float * src_f, nv_bfloat16 * dst_b) {
+    *dst_b = *src_f;
+}
+
 template<>
 __device__ __forceinline__ void set_rows_1<float, float>(const float * src_f, float * dst_f) {
     *dst_f = *src_f;
@@ -124,6 +129,16 @@ void ggml_cuda_op_set_rows(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
             nb1, nb2, nb3,
             stream
         );
+    } else if (dst->type == GGML_TYPE_BF16) {
+        set_rows_cuda(
+            src0_d, src1_d, (nv_bfloat16*)dst->data,
+            ne00, ne01, ne02, ne03,
+            ne10, ne11, ne12, ne13,
+            nb01, nb02, nb03,
+            nb10, nb11, nb12,
+            nb1, nb2, nb3,
+            stream
+        );
     } else {
         GGML_ABORT("unsupported type");
     }
Repository: vercel/next.js
Pull request: Turbopack Build: Update manifest for #80063 fix

## What?

Didn't update the manifest in #80063, so here's the update 😄 This gets us down to 20 tests left.

Closes PACK-4753

Changed files:
filename: test/turbopack-build-tests-manifest.json
patch: @@ -7306,12 +7306,11 @@
       "Middleware Runtime without i18n should validate & parse request url from any route",
       "Middleware Runtime without i18n should warn when using NextResponse.redirect with a relative URL",
       "Middleware Runtime without i18n should warn when using Response.redirect with a relative URL",
-      "Middleware Runtime without i18n should work with notFound: true correctly"
-    ],
-    "failed": [
+      "Middleware Runtime without i18n should work with notFound: true correctly",
       "Middleware Runtime with i18n should have the custom config in the manifest",
       "Middleware Runtime without i18n should have the custom config in the manifest"
     ],
+    "failed": [],
     "pending": [],
     "flakey": [],
     "runtimeError": false
Repository: denoland/deno
Pull request: fix(fmt): error instead of panic on unstable format


Changed files:
filename: cli/tools/fmt.rs
patch: @@ -790,28 +790,26 @@ fn format_ensure_stable(
             return Ok(Some(current_text));
           }
           Err(err) => {
-            panic!(
+            bail!(
               concat!(
                 "Formatting succeeded initially, but failed when ensuring a ",
                 "stable format. This indicates a bug in the formatter where ",
                 "the text it produces is not syntactically correct. As a temporary ",
-                "workaround you can ignore this file ({}).\n\n{:#}"
+                "workaround you can ignore this file.\n\n{:#}"
               ),
-              file_path.display(),
               err,
             )
           }
         }
         count += 1;
         if count == 5 {
-          panic!(
+          bail!(
             concat!(
               "Formatting not stable. Bailed after {} tries. This indicates a bug ",
-              "in the formatter where it formats the file ({}) differently each time. As a ",
+              "in the formatter where it formats the file differently each time. As a ",
               "temporary workaround you can ignore this file."
             ),
             count,
-            file_path.display(),
           )
         }
       }
@@ -1215,6 +1213,8 @@ fn is_supported_ext_fmt(path: &Path) -> bool {
 
 #[cfg(test)]
 mod test {
+  use test_util::assert_starts_with;
+
   use super::*;
 
   #[test]
@@ -1270,12 +1270,16 @@ mod test {
   }
 
   #[test]
-  #[should_panic(expected = "Formatting not stable. Bailed after 5 tries.")]
   fn test_format_ensure_stable_unstable_format() {
-    format_ensure_stable(&PathBuf::from("mod.ts"), "1", |_, file_text| {
-      Ok(Some(format!("1{file_text}")))
-    })
-    .unwrap();
+    let err =
+      format_ensure_stable(&PathBuf::from("mod.ts"), "1", |_, file_text| {
+        Ok(Some(format!("1{file_text}")))
+      })
+      .unwrap_err();
+    assert_starts_with!(
+      err.to_string(),
+      "Formatting not stable. Bailed after 5 tries."
+    );
   }
 
   #[test]
@@ -1289,16 +1293,20 @@ mod test {
   }
 
   #[test]
-  #[should_panic(expected = "Formatting succeeded initially, but failed when")]
   fn test_format_ensure_stable_error_second() {
-    format_ensure_stable(&PathBuf::from("mod.ts"), "1", |_, file_text| {
-      if file_text == "1" {
-        Ok(Some("11".to_string()))
-      } else {
-        bail!("Error formatting.")
-      }
-    })
-    .unwrap();
+    let err =
+      format_ensure_stable(&PathBuf::from("mod.ts"), "1", |_, file_text| {
+        if file_text == "1" {
+          Ok(Some("11".to_string()))
+        } else {
+          bail!("Error formatting.")
+        }
+      })
+      .unwrap_err();
+    assert_starts_with!(
+      err.to_string(),
+      "Formatting succeeded initially, but failed when"
+    );
   }
 
   #[test]
Repository: ggml-org/llama.cpp
Pull request: Add ELU CUDA support

Will rebase on top of master after https://github.com/ggml-org/llama.cpp/pull/14639 merge.
I am creating smaller PRs as should be easier to review and test.

Changed files:
filename: ggml/src/ggml-cuda/ggml-cuda.cu
patch: @@ -2303,6 +2303,9 @@ static bool ggml_cuda_compute_forward(ggml_backend_cuda_context & ctx, struct gg
                 case GGML_UNARY_OP_EXP:
                     ggml_cuda_op_exp(ctx, dst);
                     break;
+                case GGML_UNARY_OP_ELU:
+                    ggml_cuda_op_elu(ctx, dst);
+                    break;
                 default:
                     return false;
             }
@@ -3116,6 +3119,7 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
                 case GGML_UNARY_OP_GELU_QUICK:
                 case GGML_UNARY_OP_TANH:
                 case GGML_UNARY_OP_EXP:
+                case GGML_UNARY_OP_ELU:
                     return ggml_is_contiguous(op->src[0]);
                 default:
                     return false;

filename: ggml/src/ggml-cuda/unary.cu
patch: @@ -83,6 +83,10 @@ static __device__ __forceinline__ float op_log(float x) {
     return logf(x);
 }
 
+static __device__ __forceinline__ float op_elu(float x) {
+    return (x > 0.f) ? x : expm1f(x);
+}
+
 template <float (*op)(float), typename T>
 static __global__ void unary_op_kernel(const T * x, T * dst, const int k) {
     const int i = blockDim.x*blockIdx.x + threadIdx.x;
@@ -196,6 +200,9 @@ void ggml_cuda_op_log(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
     ggml_cuda_op_unary<op_log>(ctx, dst);
 }
 
+void ggml_cuda_op_elu(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
+    ggml_cuda_op_unary<op_elu>(ctx, dst);
+}
 /* gated ops */
 
 template <float (*op)(float), typename T>

filename: ggml/src/ggml-cuda/unary.cuh
patch: @@ -59,6 +59,8 @@ void ggml_cuda_op_cos(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
 
 void ggml_cuda_op_log(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
 
+void ggml_cuda_op_elu(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
+
 void ggml_cuda_op_reglu(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
 
 void ggml_cuda_op_geglu(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
Repository: huggingface/transformers
Pull request: Update Loss Functions to Accept Tensor num_items_in_batch

This PR updates the ForCausalLMLoss and ForMaskedLMLoss functions to handle num_items_in_batch as a torch.Tensor instead of an int, aligning with how the parameter is actually passed during training.

Changes:

Updated num_items_in_batch: Optional[int] → Optional[torch.Tensor] in both functions.

Applied .item() conversion when computing loss to retain compatibility with fixed_cross_entropy.


Changed files:
filename: src/transformers/loss/loss_utils.py
patch: @@ -35,6 +35,11 @@ def fixed_cross_entropy(
     reduction = "sum" if num_items_in_batch is not None else "mean"
     loss = nn.functional.cross_entropy(source, target, ignore_index=ignore_index, reduction=reduction)
     if reduction == "sum":
+        if not isinstance(num_items_in_batch, torch.Tensor):
+            num_items_in_batch = torch.tensor(num_items_in_batch, device=loss.device, dtype=loss.dtype)
+        elif num_items_in_batch.device != loss.device:
+            num_items_in_batch = num_items_in_batch.to(loss.device)
+
         loss = loss / num_items_in_batch
     return loss
Repository: huggingface/transformers
Pull request: Num parameters in model.safetensors.index.json

Serialize the number of parameters in the safetensors index so that the number of params is easily accessible even with sharded or quantized checkpoints

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -3750,7 +3750,7 @@ def save_pretrained(
         index = None
         if state_dict_split.is_sharded:
             index = {
-                "metadata": state_dict_split.metadata,
+                "metadata": {"total_parameters": self.num_parameters(), **state_dict_split.metadata},
                 "weight_map": state_dict_split.tensor_to_filename,
             }
Repository: vercel/next.js
Pull request: [dev-overlay] Remove unused hydration error state

Leftover from when we stopped squashing hydration errors when React 19 is used.

Changed files:
filename: packages/next/src/client/components/errors/hydration-error-info.ts
patch: @@ -1,17 +1,5 @@
-export type HydrationErrorState = {
-  // Hydration warning template format: <message> <serverContent> <clientContent>
-  warning?: [string, string, string]
-  serverContent?: string
-  clientContent?: string
-  // React 19 hydration diff format: <notes> <link> <component diff?>
-  notes?: string
-  reactOutputComponentDiff?: string
-}
-
 type NullableText = string | null | undefined
 
-export const hydrationErrorState: HydrationErrorState = {}
-
 // https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference
 const htmlTagsWarnings = new Set([
   'Warning: In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s',
Repository: ggml-org/llama.cpp
Pull request: test-backend-ops : cover lfm2 cases in test_ssm_conv

In #14620 @compilade [suggested ](https://github.com/ggml-org/llama.cpp/pull/14620#discussion_r2201006560) adding tests for `test_ssm_conv` `d_conv = 3`.

PR adds testing of `d_conv = 3` and additionally `d_inner = 1024` and `d_inner = 2048` used in LFM2.

Changed files:
filename: tests/test-backend-ops.cpp
patch: @@ -5170,9 +5170,13 @@ static std::vector<std::unique_ptr<test_case>> make_test_cases_eval() {
 
     test_cases.emplace_back(new test_l2_norm(GGML_TYPE_F32, {64, 5, 4, 3}, 1e-12f));
 
-    test_cases.emplace_back(new test_ssm_conv(GGML_TYPE_F32, {4, 1536, 1, 1}, {4, 1536, 1, 1}));
-    test_cases.emplace_back(new test_ssm_conv(GGML_TYPE_F32, {8, 1536, 1, 1}, {4, 1536, 1, 1}));
-    test_cases.emplace_back(new test_ssm_conv(GGML_TYPE_F32, {4, 1536, 4, 1}, {4, 1536, 1, 1}));
+    for (int64_t d_conv : {3, 4}) {
+        for (int64_t d_inner: {1024, 1536, 2048}) {
+            test_cases.emplace_back(new test_ssm_conv(GGML_TYPE_F32, {4, d_inner, 1, 1}, {d_conv, d_inner, 1, 1}));
+            test_cases.emplace_back(new test_ssm_conv(GGML_TYPE_F32, {8, d_inner, 1, 1}, {d_conv, d_inner, 1, 1}));
+            test_cases.emplace_back(new test_ssm_conv(GGML_TYPE_F32, {4, d_inner, 4, 1}, {d_conv, d_inner, 1, 1}));
+        }
+    }
 
     test_cases.emplace_back(new test_ssm_scan(GGML_TYPE_F32, 16, 1, 1024, 1, 32, 4)); // Mamba-1
     test_cases.emplace_back(new test_ssm_scan(GGML_TYPE_F32, 128, 64, 16, 2, 32, 4)); // Mamba-2
Repository: nodejs/node
Pull request: doc: add additional caveat for fs.watch

Add clarification based on discussion with security researcher.

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: doc/api/fs.md
patch: @@ -4772,6 +4772,12 @@ unavailable in some situations.
 On Windows, no events will be emitted if the watched directory is moved or
 renamed. An `EPERM` error is reported when the watched directory is deleted.
 
+The `fs.watch` API does not provide any protection with respect
+to malicious actions on the file system. For example, on Windows it is
+implemented by monitoring changes in a directory versus specific files. This
+allows substitution of a file and fs reporting changes on the new file
+with the same filename.
+
 ##### Availability
 
 <!--type=misc-->
Repository: huggingface/transformers
Pull request: [flax/mistral] support sliding_window: null in config

# What does this PR do?

Adds support for `sliding_window: null` in FlaxMistral llm models. This is needed for models like Mistral-small. The corresponding pytorch model code already supports this.

# Before Submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [X] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests), Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [ ] Did you write any new necessary tests?

## Who can review?

@ArthurZucker  @kiansierra 

Changed files:
filename: src/transformers/models/mistral/modeling_flax_mistral.py
patch: @@ -240,8 +240,8 @@ def setup(self):
         self.v_proj = nn.Dense(self.num_key_value_heads * self.head_dim, use_bias=False, dtype=self.dtype)
         self.o_proj = nn.Dense(self.hidden_size, use_bias=False, dtype=self.dtype)
         casual_mask = make_causal_mask(jnp.ones((1, config.max_position_embeddings), dtype="bool"), dtype="bool")
-        self.causal_mask = jnp.triu(casual_mask, k=-config.sliding_window)
-        self.rotary_emb = FlaxMistralRotaryEmbedding(config, dtype=self.dtype)
+        self.causal_mask = jnp.triu(casual_mask, k=-(config.sliding_window or 0))
+        self.rotary_emb = FlaxMistralRotaryEmbedding(self.config, dtype=self.dtype)
 
     def _split_heads(self, hidden_states, num_heads):
         return hidden_states.reshape(hidden_states.shape[:2] + (num_heads, self.head_dim))
Repository: denoland/deno
Pull request: fix(ext/node): use ERR_NOT_IMPLEMENTED for notImplemented


Changed files:
filename: ext/node/polyfills/_utils.ts
patch: @@ -17,6 +17,7 @@ const {
 import { TextDecoder, TextEncoder } from "ext:deno_web/08_text_encoding.js";
 import { errorMap } from "ext:deno_node/internal_binding/uv.ts";
 import { codes } from "ext:deno_node/internal/error_codes.ts";
+import { ERR_NOT_IMPLEMENTED } from "ext:deno_node/internal/errors.ts";
 
 export type BinaryEncodings = "binary";
 
@@ -34,8 +35,7 @@ export type TextEncodings =
 export type Encodings = BinaryEncodings | TextEncodings;
 
 export function notImplemented(msg: string): never {
-  const message = msg ? `Not implemented: ${msg}` : "Not implemented";
-  throw new Error(message);
+  throw new ERR_NOT_IMPLEMENTED(msg);
 }
 
 export function warnNotImplemented(msg?: string) {

filename: ext/node/polyfills/internal/errors.ts
patch: @@ -2390,6 +2390,15 @@ export class ERR_INVALID_RETURN_VALUE extends NodeTypeError {
   }
 }
 
+export class ERR_NOT_IMPLEMENTED extends NodeError {
+  constructor(message?: string) {
+    super(
+      "ERR_NOT_IMPLEMENTED",
+      message ? `Not implemented: ${message}` : "Not implemented",
+    );
+  }
+}
+
 export class ERR_INVALID_URL extends NodeTypeError {
   input: string;
   constructor(input: string) {
@@ -2862,6 +2871,7 @@ export default {
   ERR_INVALID_SYNC_FORK_INPUT,
   ERR_INVALID_THIS,
   ERR_INVALID_TUPLE,
+  ERR_NOT_IMPLEMENTED,
   ERR_INVALID_URI,
   ERR_INVALID_URL,
   ERR_INVALID_URL_SCHEME,

filename: tests/unit_node/perf_hooks_test.ts
patch: @@ -1,6 +1,10 @@
 // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
 import * as perfHooks from "node:perf_hooks";
-import { performance, PerformanceObserver } from "node:perf_hooks";
+import {
+  monitorEventLoopDelay,
+  performance,
+  PerformanceObserver,
+} from "node:perf_hooks";
 import { assertEquals, assertThrows } from "@std/assert";
 
 Deno.test({
@@ -68,3 +72,12 @@ Deno.test("[perf_hooks]: eventLoopUtilization", () => {
   assertEquals(typeof obj.active, "number");
   assertEquals(typeof obj.utilization, "number");
 });
+
+Deno.test("[perf_hooks]: monitorEventLoopDelay", () => {
+  const e = assertThrows(() => {
+    monitorEventLoopDelay({ resolution: 1 });
+  });
+
+  // deno-lint-ignore no-explicit-any
+  assertEquals((e as any).code, "ERR_NOT_IMPLEMENTED");
+});
Repository: ggml-org/llama.cpp
Pull request: readme : add LFM2 to models section

Follow up of #14620 to add LFM2 into the models section of README.md.

Kudos to @RyanJRogers for catching it.

Changed files:
filename: README.md
patch: @@ -133,6 +133,7 @@ Instructions for adding support for new models: [HOWTO-add-model.md](docs/develo
 - [x] [GigaChat-20B-A3B](https://huggingface.co/ai-sage/GigaChat-20B-A3B-instruct)
 - [X] [Trillion-7B-preview](https://huggingface.co/trillionlabs/Trillion-7B-preview)
 - [x] [Ling models](https://huggingface.co/collections/inclusionAI/ling-67c51c85b34a7ea0aba94c32)
+- [x] [LFM2 models](https://huggingface.co/collections/LiquidAI/lfm2-686d721927015b2ad73eaa38)
 
 #### Multimodal
Repository: nodejs/node
Pull request: doc: fix typo in Windows building instructions

I tried building node.js on Windows following the instructions and the path to the configurations is wrong:
```
PS C:\Users\Tim\code\node> winget configure .\configurations\configuration.dsc.yaml
File does not exist: .\configurations\configuration.dsc.yaml
PS C:\Users\Tim\code\node> winget configure .\.configurations\configuration.dsc.yaml
Apply :: WinGetPackage [pythonPackage]
```

<!--
Before submitting a pull request, please read:

- the CONTRIBUTING guide at https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md
- the commit message formatting guidelines at
  https://github.com/nodejs/node/blob/HEAD/doc/contributing/pull-requests.md#commit-message-guidelines

For code changes:
1. Include tests for any bug fixes or new features.
2. Update documentation if relevant.
3. Ensure that `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes.

If you believe this PR should be highlighted in the Node.js CHANGELOG
please add the `notable-change` label.

Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
    have the right to submit it under the open source license
    indicated in the file; or

(b) The contribution is based upon previous work that, to the best
    of my knowledge, is covered under an appropriate open source
    license and I have the right under that license to submit that
    work with modifications, whether created in whole or in part
    by me, under the same open source license (unless I am
    permitted to submit under a different license), as indicated
    in the file; or

(c) The contribution was provided directly to me by some other
    person who certified (a), (b) or (c) and I have not modified
    it.

(d) I understand and agree that this project and the contribution
    are public and that a record of the contribution (including all
    personal information I submit with it, including my sign-off) is
    maintained indefinitely and may be redistributed consistent with
    this project or the open source license(s) involved.
-->


Changed files:
filename: BUILDING.md
patch: @@ -728,7 +728,7 @@ easily. These files will install the following
 To install Node.js prerequisites from Powershell Terminal:
 
 ```powershell
-winget configure .\configurations\configuration.dsc.yaml
+winget configure .\.configurations\configuration.dsc.yaml
 ```
 
 Alternatively, you can use [Dev Home](https://learn.microsoft.com/en-us/windows/dev-home/)