helloadhavan/github_issues huggingface dataset:
Repository: vercel/next.js
Pull request: Removes onNavigate from transition scope

### What?

Fixes a bug in the Link component where state updates inside an onNavigate callback aren't committed.

### Why?

`onNavigate` is intended to provide a way to create transition animations and pending states during navigation, but state updates within the handler weren't taking effect due to them being batched with the page state change transition. This made it impossible to properly implement pending UI states using this API, forcing developers to fall back to the less appropriate onClick handler (which had its own issues like triggering when opening links in new tabs).

See [this comment](https://github.com/vercel/next.js/issues/78361#issuecomment-2833542736) on #78361 for details.

### How?

By removing the onNavigate handler from the transition scope that the navigation action is called within, user's are given the option to determine whether their state update should be priority — not batched with the route update — or a background update — batched with the route update, by whether or not they call `startTransition` themselves in the callback they pass to `onNavigate`.

Calling `preventDefault()` on the passed event works as before.

Fixes #78361 


Changed files:
filename: packages/next/src/client/app-dir/link.tsx
patch: @@ -271,30 +271,28 @@ function linkClicked(
 
   e.preventDefault()
 
-  const navigate = () => {
-    if (onNavigate) {
-      let isDefaultPrevented = false
+  if (onNavigate) {
+    let isDefaultPrevented = false
 
-      onNavigate({
-        preventDefault: () => {
-          isDefaultPrevented = true
-        },
-      })
+    onNavigate({
+      preventDefault: () => {
+        isDefaultPrevented = true
+      },
+    })
 
-      if (isDefaultPrevented) {
-        return
-      }
+    if (isDefaultPrevented) {
+      return
     }
+  }
 
+  React.startTransition(() => {
     dispatchNavigateAction(
       as || href,
       replace ? 'replace' : 'push',
       scroll ?? true,
       linkInstanceRef.current
     )
-  }
-
-  React.startTransition(navigate)
+  })
 }
 
 function formatStringOrUrl(urlObjOrString: UrlObject | string): string {
Repository: ggml-org/llama.cpp
Pull request: Move GLM4 f32 attention fix to the correct function

@ggerganov You merged SWA support (#13194) 3 hours before I merged my GLM4 fix (#13639). They touched the same build_attn functions, so there should have been a merge conflict. For whatever reason, my patch was applied to the newly-created `build_attn` function with a unified_iswa kv cache, which is not used by GLM4. So it didn't work anymore. Here's the fix, moving my patch back to the unified build_attn function... I don't think I've seen something like this before, quite the coincidence.

Changed files:
filename: src/llama-graph.cpp
patch: @@ -1287,6 +1287,10 @@ ggml_tensor * llm_graph_context::build_attn(
 
     if (wo) {
         cur = build_lora_mm(wo, cur);
+        if (arch == LLM_ARCH_GLM4) {
+            // GLM4 seems to have numerical issues with half-precision accumulators
+            ggml_mul_mat_set_prec(cur, GGML_PREC_F32);
+        }
     }
 
     if (wo_b) {
@@ -1367,10 +1371,6 @@ ggml_tensor * llm_graph_context::build_attn(
 
     if (wo) {
         cur = build_lora_mm(wo, cur);
-        if (arch == LLM_ARCH_GLM4) {
-            // GLM4 seems to have numerical issues with half-precision accumulators
-            ggml_mul_mat_set_prec(cur, GGML_PREC_F32);
-        }
     }
 
     if (wo_b) {
Repository: ggml-org/llama.cpp
Pull request: Fix GLM4 incoherence with fp16 accumulators

This fixes GLM4-32B on Vulkan in combination with #13607 

Changed files:
filename: src/llama-graph.cpp
patch: @@ -1368,6 +1368,10 @@ ggml_tensor * llm_graph_context::build_attn(
 
     if (wo) {
         cur = build_lora_mm(wo, cur);
+        if (arch == LLM_ARCH_GLM4) {
+            // GLM4 seems to have numerical issues with half-precision accumulators
+            ggml_mul_mat_set_prec(cur, GGML_PREC_F32);
+        }
     }
 
     if (wo_b) {
Repository: denoland/deno
Pull request: fix(ext/node): stub `process.cpuUsage()`

This PR adds a stub implementation of `process.cpuUsage()`. This unblocks `npm:elastic-apm-node` package working

closes #23401

Changed files:
filename: ext/node/polyfills/process.ts
patch: @@ -430,6 +430,14 @@ Process.prototype.config = {
   },
 };
 
+Process.prototype.cpuUsage = function () {
+  warnNotImplemented("process.cpuUsage()");
+  return {
+    user: 0,
+    system: 0,
+  };
+};
+
 /** https://nodejs.org/api/process.html#process_process_cwd */
 Process.prototype.cwd = cwd;
 

filename: tests/unit_node/process_test.ts
patch: @@ -1131,3 +1131,9 @@ Deno.test(function importedExecArgvTest() {
 Deno.test(function importedExecPathTest() {
   assertEquals(importedExecPath, Deno.execPath());
 });
+
+Deno.test("process.cpuUsage()", () => {
+  const cpuUsage = process.cpuUsage();
+  assert(typeof cpuUsage.user === "number");
+  assert(typeof cpuUsage.system === "number");
+});
Repository: ggml-org/llama.cpp
Pull request: ggml : add ggml_gelu_erf() CUDA kernel

Cont https://github.com/ggml-org/llama.cpp/pull/13667

This adds support for `ggml_gelu_erf()` on CUDA


Changed files:
filename: ggml/src/ggml-cuda/ggml-cuda.cu
patch: @@ -2192,6 +2192,9 @@ static bool ggml_cuda_compute_forward(ggml_backend_cuda_context & ctx, struct gg
                 case GGML_UNARY_OP_SILU:
                     ggml_cuda_op_silu(ctx, dst);
                     break;
+                case GGML_UNARY_OP_GELU_ERF:
+                    ggml_cuda_op_gelu_erf(ctx, dst);
+                    break;
                 case GGML_UNARY_OP_GELU_QUICK:
                     ggml_cuda_op_gelu_quick(ctx, dst);
                     break;
@@ -2977,6 +2980,7 @@ static bool ggml_backend_cuda_device_supports_op(ggml_backend_dev_t dev, const g
                 case GGML_UNARY_OP_SIGMOID:
                 case GGML_UNARY_OP_HARDSIGMOID:
                 case GGML_UNARY_OP_HARDSWISH:
+                case GGML_UNARY_OP_GELU_ERF:
                 case GGML_UNARY_OP_GELU_QUICK:
                 case GGML_UNARY_OP_TANH:
                 case GGML_UNARY_OP_EXP:

filename: ggml/src/ggml-cuda/unary.cu
patch: @@ -23,6 +23,12 @@ static __device__ __forceinline__ float op_gelu(float x) {
     return 0.5f*x*(1.0f + tanhf(SQRT_2_OVER_PI*x*(1.0f + GELU_COEF_A*x*x)));
 }
 
+static __device__ __forceinline__ float op_gelu_erf(float x) {
+    const float SQRT_2_INV = 0.70710678118654752440084436210484f;
+
+    return 0.5f*x*(1.0f + erff(x*SQRT_2_INV));
+}
+
 static __device__ __forceinline__ float op_gelu_quick(float x) {
     const float GELU_QUICK_COEF = -1.702f;
 
@@ -134,6 +140,10 @@ void ggml_cuda_op_gelu(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
     ggml_cuda_op_unary<op_gelu>(ctx, dst);
 }
 
+void ggml_cuda_op_gelu_erf(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
+    ggml_cuda_op_unary<op_gelu_erf>(ctx, dst);
+}
+
 void ggml_cuda_op_gelu_quick(ggml_backend_cuda_context & ctx, ggml_tensor * dst) {
     ggml_cuda_op_unary<op_gelu_quick>(ctx, dst);
 }

filename: ggml/src/ggml-cuda/unary.cuh
patch: @@ -30,6 +30,8 @@ void ggml_cuda_op_silu(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
 
 void ggml_cuda_op_silu_back(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
 
+void ggml_cuda_op_gelu_erf(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
+
 void ggml_cuda_op_gelu_quick(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
 
 void ggml_cuda_op_tanh(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
Repository: huggingface/transformers
Pull request: Skip is_flaky tests in the CI


Changed files:
filename: .circleci/create_circleci_config.py
patch: @@ -28,6 +28,8 @@
     "TRANSFORMERS_IS_CI": True,
     "PYTEST_TIMEOUT": 120,
     "RUN_PIPELINE_TESTS": False,
+    # will be adjust in `CircleCIJob.to_dict`.
+    "RUN_FLAKY": True,
 }
 # Disable the use of {"s": None} as the output is way too long, causing the navigation on CircleCI impractical
 COMMON_PYTEST_OPTIONS = {"max-worker-restart": 0, "vvv": None, "rsfE":None}
@@ -126,6 +128,8 @@ def __post_init__(self):
 
     def to_dict(self):
         env = COMMON_ENV_VARIABLES.copy()
+        # Do not run tests decorated by @is_flaky on pull requests
+        env['RUN_FLAKY'] = os.environ.get("CIRCLE_PULL_REQUEST", "") == ""
         env.update(self.additional_env)
 
         job = {

filename: src/transformers/testing_utils.py
patch: @@ -240,6 +240,7 @@ def parse_int_from_env(key, default=None):
 
 
 _run_slow_tests = parse_flag_from_env("RUN_SLOW", default=False)
+_run_flaky_tests = parse_flag_from_env("RUN_FLAKY", default=True)
 _run_custom_tokenizers = parse_flag_from_env("RUN_CUSTOM_TOKENIZERS", default=False)
 _run_staging = parse_flag_from_env("HUGGINGFACE_CO_STAGING", default=False)
 _run_pipeline_tests = parse_flag_from_env("RUN_PIPELINE_TESTS", default=True)
@@ -2614,7 +2615,7 @@ def wrapper(*args, **kwargs):
 
             return test_func_ref(*args, **kwargs)
 
-        return wrapper
+        return unittest.skipUnless(_run_flaky_tests, "test is flaky")(wrapper)
 
     return decorator
Repository: nodejs/node
Pull request: doc: update gcc-version and build for Ubuntu 22.04.5 LTS

fixes  #56475

Changed files:
filename: BUILDING.md
patch: @@ -241,7 +241,7 @@ Consult previous versions of this document for older versions of Node.js:
 
 Installation via Linux package manager can be achieved with:
 
-* Ubuntu, Debian: `sudo apt-get install python3 g++ make python3-pip`
+* Ubuntu, Debian: `sudo apt-get install python3 g++-12 gcc-12 make python3-pip`
 * Fedora: `sudo dnf install python3 gcc-c++ make python3-pip`
 * CentOS and RHEL: `sudo yum install python3 gcc-c++ make python3-pip`
 * OpenSUSE: `sudo zypper install python3 gcc-c++ make python3-pip`
@@ -269,6 +269,7 @@ fail.
 To build Node.js:
 
 ```bash
+export CXX=g++-12
 ./configure
 make -j4
 ```
Repository: vercel/next.js
Pull request: fix(CI): Remove e2e test timeout overrides from rspack & turbopack suites

**The default timeout is 1 minute.** This PR reduces the timeouts for these tests from 4 minutes to 1 minute.

Maybe these overrides made sense at some point, but turbopack shouldn't ever be significantly slower than webpack in any test (if it is, that's a bug), so we shouldn't need larger timeouts for these.

This long 4 minute timeout has contributed to github action job timeouts we've previously experienced for the arewerspack/areweturboyet nightly jobs, so IMO it's hurting more than it's helping.

areweturboyet development tests: https://github.com/vercel/next.js/actions/runs/14893493964
areweturboyet production tests: https://github.com/vercel/next.js/actions/runs/14893499248

Closes PACK-4547

Changed files:
filename: .github/workflows/build_and_test.yml
patch: @@ -238,7 +238,6 @@ jobs:
         export NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-dev-tests-manifest.json"
         export IS_TURBOPACK_TEST=1
         export TURBOPACK_DEV=1
-        export NEXT_E2E_TEST_TIMEOUT=240000
         export NEXT_TEST_MODE=dev
         export NEXT_TEST_REACT_VERSION="${{ matrix.react }}"
 

filename: .github/workflows/integration_tests_reusable.yml
patch: @@ -92,7 +92,6 @@ jobs:
         # e2e and ${{ inputs.test_type }} tests with `node run-tests.js`
 
         export NEXT_TEST_CONTINUE_ON_ERROR=TRUE
-        export NEXT_E2E_TEST_TIMEOUT=240000
         export NEXT_TEST_MODE=${{
           inputs.test_type == 'development' && 'dev' || 'start'
         }}
@@ -125,7 +124,6 @@ jobs:
         # legacy integration tests with `node run-tests.js`
 
         export NEXT_TEST_CONTINUE_ON_ERROR=TRUE
-        export NEXT_E2E_TEST_TIMEOUT=240000
 
         # HACK: Despite the name, these environment variables are just used to
         # gate tests, so they're applicable to both turbopack and rspack tests
Repository: ggml-org/llama.cpp
Pull request: vocab : fix ugm tokenizer precision

Under certain conditions storing the `score_sum` as float leads to imprecision and incorrect token selection.

Fixes #13725

Changed files:
filename: src/llama-vocab.cpp
patch: @@ -835,7 +835,7 @@ struct llm_tokenizer_ugm_session {
         }
 
         // initialize score_sum to -FLT_MAX so it will be always lower than sums of token scores
-        std::vector<struct best_tokenization> tokenization_results(input_len + 1, {vocab.token_unk(), 0, -FLT_MAX});
+        std::vector<struct best_tokenization> tokenization_results(input_len + 1, {vocab.token_unk(), 0, -DBL_MAX});
         // at the beginning tokenization score is zero
         tokenization_results[0] = { vocab.token_unk(), 0, 0 };
 
@@ -867,7 +867,7 @@ struct llm_tokenizer_ugm_session {
                     const double challenger_score = current_best.score_sum + token_score;
                     struct best_tokenization & current_champ = tokenization_results[prefix_offset];
                     if (challenger_score > current_champ.score_sum) {
-                        struct best_tokenization challenger = { token_id, input_offset, (float) challenger_score };
+                        struct best_tokenization challenger = { token_id, input_offset, challenger_score };
                         current_champ = challenger;
                     }
                 }
@@ -881,7 +881,7 @@ struct llm_tokenizer_ugm_session {
                 prefix_offset = input_offset + n_utf8_code_units;
                 struct best_tokenization & current_champ = tokenization_results[prefix_offset];
                 if (challenger_score > current_champ.score_sum) {
-                    struct best_tokenization challenger = { vocab.token_unk(), input_offset, (float) challenger_score };
+                    struct best_tokenization challenger = { vocab.token_unk(), input_offset, challenger_score };
                     current_champ = challenger;
                 }
             }
@@ -1007,7 +1007,7 @@ struct llm_tokenizer_ugm_session {
     struct best_tokenization {
         llama_token token_id;
         size_t input_offset;
-        float score_sum;
+        double score_sum;
     };
 
     struct normalization_result normalize_prefix(const std::string & input, size_t input_offset) {
Repository: denoland/deno
Pull request: fix(config): validate export names

The property names of the `exports` field in `deno.json` was never validated. The `patternProperties` only validates values, whose property name matches the regex. It doesn't validate the property names themselves. That's what `propertyNames` is for.

Related https://github.com/denoland/deno/issues/25435

Changed files:
filename: cli/schemas/config-file.v1.json
patch: @@ -622,6 +622,11 @@
         {
           "type": "object",
           "description": "A map of package exports to files in this JSR package.",
+          "propertyNames": {
+            "description": "Package export name",
+            "examples": [".", "./foo", "./bar"],
+            "pattern": "^\\.(/.*)?$"
+          },
           "patternProperties": {
             "^\\.(/.*)?$": {
               "type": "string",
Repository: denoland/deno
Pull request: BREAKING(fs): remove `Deno.FsWatcher.prototype.rid`

Towards #22079

Changed files:
filename: cli/tsc/dts/lib.deno.ns.d.ts
patch: @@ -3849,14 +3849,6 @@ declare namespace Deno {
    * @category File System
    */
   export interface FsWatcher extends AsyncIterable<FsEvent>, Disposable {
-    /**
-     * The resource id.
-     *
-     * @deprecated This will be removed in Deno 2.0. See the
-     * {@link https://docs.deno.com/runtime/manual/advanced/migrate_deprecations | Deno 1.x to 2.x Migration Guide}
-     * for migration instructions.
-     */
-    readonly rid: number;
     /** Stops watching the file system and closes the watcher resource. */
     close(): void;
     /**

filename: runtime/js/40_fs_events.js
patch: @@ -31,15 +31,6 @@ class FsWatcher {
     this.#rid = op_fs_events_open({ recursive, paths });
   }
 
-  get rid() {
-    internals.warnOnDeprecatedApi(
-      "Deno.FsWatcher.rid",
-      new Error().stack,
-      "Use `Deno.FsWatcher` instance methods instead.",
-    );
-    return this.#rid;
-  }
-
   unref() {
     core.unrefOpPromise(this.#promise);
   }

filename: tests/specs/future/runtime_api/main.js
patch: @@ -53,10 +53,6 @@ console.log("Deno.TlsConn.prototype.rid is", tlsConn.rid);
 
 tlsConn.close();
 
-const watcher = Deno.watchFs(".");
-console.log("Deno.FsWatcher.prototype.rid is", watcher.rid);
-watcher.close();
-
 try {
   new Deno.FsFile(0);
 } catch (error) {

filename: tests/specs/future/runtime_api/main.out
patch: @@ -10,7 +10,6 @@ Deno.Conn.prototype.rid is undefined
 Deno.UnixConn.prototype.rid is undefined
 Deno.TlsListener.prototype.rid is undefined
 Deno.TlsConn.prototype.rid is undefined
-Deno.FsWatcher.prototype.rid is undefined
 Deno.FsFile constructor is illegal
 Deno.ConnectTlsOptions.(certFile|keyFile) do nothing
 Deno.ConnectTlsOptions.(certChain|privateKey) do nothing
Repository: huggingface/transformers
Pull request: Update modeling_llama4.py

# What does this PR do?

Fixes an error in Llama4TextModel._prepare_4d_causal_attention_mask_with_cache_position() by adding the missing device parameter. This resolves TypeError #37840 that occurs when trying to evaluate Llama-4 models.

Fixes #37840


## Before submitting

- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      Pull Request section?
- [x] 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.

## Who can review?
@ArthurZucker as this relates to text models

Changed files:
filename: src/transformers/models/llama4/modeling_llama4.py
patch: @@ -873,7 +873,6 @@ def _prepare_4d_causal_attention_mask_with_cache_position(
         sequence_length: int,
         target_length: int,
         dtype: torch.dtype,
-        device: torch.device,
         cache_position: torch.Tensor,
         batch_size: int,
         **kwargs,
@@ -906,16 +905,18 @@ def _prepare_4d_causal_attention_mask_with_cache_position(
         else:
             min_dtype = torch.finfo(dtype).min
             causal_mask = torch.full(
-                (sequence_length, target_length), fill_value=min_dtype, dtype=dtype, device=device
+                (sequence_length, target_length), fill_value=min_dtype, dtype=dtype, device=cache_position.device
             )
             if sequence_length != 1:
                 causal_mask = torch.triu(causal_mask, diagonal=1)
-            causal_mask *= torch.arange(target_length, device=device) > cache_position.to(device).reshape(-1, 1)
+            causal_mask *= torch.arange(target_length, device=cache_position.device) > cache_position.reshape(-1, 1)
             causal_mask = causal_mask[None, None, :, :].expand(batch_size, 1, -1, -1)
             if attention_mask is not None:
                 causal_mask = causal_mask.clone()  # copy to contiguous memory for in-place edit
                 mask_length = attention_mask.shape[-1]
-                padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :].to(device)
+                padding_mask = causal_mask[:, :, :, :mask_length] + attention_mask[:, None, None, :].to(
+                    cache_position.device
+                )
                 padding_mask = padding_mask == 0
                 causal_mask[:, :, :, :mask_length] = causal_mask[:, :, :, :mask_length].masked_fill(
                     padding_mask, min_dtype
Repository: nodejs/node
Pull request: doc: fix parentheses in options

<!--
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/child_process.md
patch: @@ -536,7 +536,7 @@ changes:
 * `options` {Object}
   * `cwd` {string|URL} Current working directory of the child process.
   * `detached` {boolean} Prepare child process to run independently of its
-    parent process. Specific behavior depends on the platform, see
+    parent process. Specific behavior depends on the platform (see
     [`options.detached`][]).
   * `env` {Object} Environment key-value pairs. **Default:** `process.env`.
   * `execPath` {string} Executable used to create the child process.
@@ -688,7 +688,7 @@ changes:
   * `stdio` {Array|string} Child's stdio configuration (see
     [`options.stdio`][`stdio`]).
   * `detached` {boolean} Prepare child process to run independently of
-    its parent process. Specific behavior depends on the platform, see
+    its parent process. Specific behavior depends on the platform (see
     [`options.detached`][]).
   * `uid` {number} Sets the user identity of the process (see setuid(2)).
   * `gid` {number} Sets the group identity of the process (see setgid(2)).
Repository: ggml-org/llama.cpp
Pull request: CUDA: fix race condition in FA vector kernels

Fixes https://github.com/ggml-org/llama.cpp/issues/13733 .

Looking at the code I added in https://github.com/ggml-org/llama.cpp/pull/13584 again, I think I accidentally introduced a race condition. The mask is being written to shared memory anyways, so the synchronization between warps is achieved by each warp just checking all of the mask values, and then reducing `skip` within the warp. Each warp will come to the same conclusion regarding whether or not to execute the `continue`. However, warps are not guaranteed to execute the `continue` at the same time, and after they do they will write new values to `maskf_shared` which can in turn influence whether other warps will execute the `continue`, potentially causing the warps to become desynchronized.

Changed files:
filename: ggml/src/ggml-cuda/fattn-vec-f16.cuh
patch: @@ -212,6 +212,7 @@ static __global__ void flash_attn_vec_ext_f16(
                 }
             }
             if (__all_sync(0xFFFFFFFF, skip)) {
+                __syncthreads();
                 continue;
             }
 #endif // GGML_USE_HIP

filename: ggml/src/ggml-cuda/fattn-vec-f32.cuh
patch: @@ -217,6 +217,7 @@ static __global__ void flash_attn_vec_ext_f32(
                 }
             }
             if (__all_sync(0xFFFFFFFF, skip)) {
+                __syncthreads();
                 continue;
             }
 #endif // GGML_USE_HIP