helloadhavan/github_issues huggingface dataset:
Repository: facebook/react
Pull request: fix(typo): Esacpe -> Escape

<!--
  Thanks for submitting a pull request!
  We appreciate you spending the time to work on these changes. Please provide enough information so that others can review your pull request. The three fields below are mandatory.

  Before submitting a pull request, please make sure the following is done:

  1. Fork [the repository](https://github.com/facebook/react) and create your branch from `main`.
  2. Run `yarn` in the repository root.
  3. If you've fixed a bug or added code that should be tested, add tests!
  4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
  5. Run `yarn test --prod` to test in the production environment. It supports the same options as `yarn test`.
  6. If you need a debugger, run `yarn debug-test --watch TestName`, open `chrome://inspect`, and press "Inspect".
  7. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
  8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

  Learn more about contributing: https://reactjs.org/docs/how-to-contribute.html
-->

## Summary

Fix typos.


<!--
 Explain the **motivation** for making this change. What existing problem does the pull request solve?
-->

## How did you test this change?

<!--
  Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface.
  How exactly did you verify that your PR solves the issue you wanted to solve?
  If you leave this empty, your PR will very likely be closed.
-->


Changed files:
filename: packages/react-interactions/events/src/dom/create-event-handle/Focus.js
patch: @@ -69,7 +69,7 @@ function isValidKey(nativeEvent: KeyboardEvent): boolean {
 
 function isTextInput(nativeEvent: KeyboardEvent): boolean {
   const {key, target} = nativeEvent;
-  if (key === 'Tab' || key === 'Esacpe') {
+  if (key === 'Tab' || key === 'Escape') {
     return false;
   }
   const {isContentEditable, tagName} = (target: any);
Repository: huggingface/transformers
Pull request: Preserve requires_grad in pre quantized model

Summary:
discovered this when running lm-eval for some models, current code will set requires_grad to True always

Test Plan:
lm_eval --model hf --model_args pretrained=jerryzh168/phi4-torchao-gguf-q4_k --tasks hellaswag --device cuda:0 --batch_size 8

Reviewers:

Subscribers:

Tasks:

Tags:

Changed files:
filename: src/transformers/quantizers/quantizer_torchao.py
patch: @@ -230,12 +230,16 @@ def create_quantized_param(
 
         module, tensor_name = get_module_from_name(model, param_name)
         if self.pre_quantized:
-            module._parameters[tensor_name] = torch.nn.Parameter(param_value.to(device=target_device))
+            module._parameters[tensor_name] = torch.nn.Parameter(
+                param_value.to(device=target_device), requires_grad=param_value.requires_grad
+            )
             if isinstance(module, nn.Linear):
                 module.extra_repr = types.MethodType(_linear_extra_repr, module)
         else:
             assert isinstance(self.quantization_config, TorchAoConfig)
-            module._parameters[tensor_name] = torch.nn.Parameter(param_value).to(device=target_device)
+            module._parameters[tensor_name] = torch.nn.Parameter(
+                param_value, requires_grad=param_value.requires_grad
+            ).to(device=target_device)
             quantize_(module, self.quantization_config.get_apply_tensor_subclass())
 
     def _process_model_after_weight_loading(self, model, **kwargs):
Repository: denoland/deno
Pull request: fix(ext/node): http request uploads of subarray of buffer should work


Closes https://github.com/denoland/deno/issues/24571

Changed files:
filename: ext/node/polyfills/_http_outgoing.ts
patch: @@ -540,7 +540,7 @@ export class OutgoingMessage extends Stream {
       data = Buffer.from(data, encoding);
     }
     if (data instanceof Buffer) {
-      data = new Uint8Array(data.buffer);
+      data = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
     }
     if (data.buffer.byteLength > 0) {
       this._bodyWriter.write(data).then(() => {

filename: tests/unit_node/http_test.ts
patch: @@ -1406,3 +1406,25 @@ Deno.test("[node/http] Server.address() can be null", () => {
   const server = http.createServer((_req, res) => res.end("it works"));
   assertEquals(server.address(), null);
 });
+
+Deno.test("[node/http] ClientRequest PUT subarray", async () => {
+  const buffer = Buffer.from("hello world");
+  const payload = buffer.subarray(6, 11);
+  let body = "";
+  const { promise, resolve, reject } = Promise.withResolvers<void>();
+  const req = http.request("http://localhost:4545/echo_server", {
+    method: "PUT",
+  }, (resp) => {
+    resp.on("data", (chunk) => {
+      body += chunk;
+    });
+
+    resp.on("end", () => {
+      resolve();
+    });
+  });
+  req.once("error", (e) => reject(e));
+  req.end(payload);
+  await promise;
+  assertEquals(body, "world");
+});
Repository: vercel/next.js
Pull request: Update turbopack.mdx

just deleted an extra letter in the docs.

Changed files:
filename: docs/01-app/05-api-reference/05-config/01-next-config-js/turbopack.mdx
patch: @@ -32,7 +32,7 @@ module.exports = nextConfig
 
 > **Good to know**:
 >
-> - Turbopack for Next.js does not require loaders nor loader configuration for built-in functionality. Turbopack has built-in support for CSS and compiling modern JavaScript, so there's no need for `css-loader`, `postcss-loader`, or `babel-loader` if you're using `@babel/preset-env`.
+> - Turbopack for Next.js does not require loaders or loader configuration for built-in functionality. Turbopack has built-in support for CSS and compiling modern JavaScript, so there's no need for `css-loader`, `postcss-loader`, or `babel-loader` if you're using `@babel/preset-env`.
 
 ## Reference
Repository: denoland/deno
Pull request: fix(std/http2): Release window capacity back to remote stream

This PR adds logic to release window capacity after reading the chunks from the stream. Without it, large response (more than `u16::MAX`) may fill up the capacity and the whole response can't be read.

Closes #24552
Closes https://github.com/denoland/deno/issues/24305

Changed files:
filename: ext/node/ops/http2.rs
patch: @@ -456,24 +456,21 @@ fn poll_data_or_trailers(
   cx: &mut std::task::Context,
   body: &mut RecvStream,
 ) -> Poll<Result<DataOrTrailers, h2::Error>> {
-  loop {
-    if let Poll::Ready(trailers) = body.poll_trailers(cx) {
-      if let Some(trailers) = trailers? {
-        return Poll::Ready(Ok(DataOrTrailers::Trailers(trailers)));
-      } else {
-        return Poll::Ready(Ok(DataOrTrailers::Eof));
-      }
-    }
-    if let Poll::Ready(data) = body.poll_data(cx) {
-      if let Some(data) = data {
-        return Poll::Ready(Ok(DataOrTrailers::Data(data?)));
-      }
-      // If data is None, loop one more time to check for trailers
-      continue;
+  if let Poll::Ready(trailers) = body.poll_trailers(cx) {
+    if let Some(trailers) = trailers? {
+      return Poll::Ready(Ok(DataOrTrailers::Trailers(trailers)));
+    } else {
+      return Poll::Ready(Ok(DataOrTrailers::Eof));
     }
-    // Return pending here as poll_data will keep the waker
-    return Poll::Pending;
   }
+  if let Poll::Ready(Some(data)) = body.poll_data(cx) {
+    let data = data?;
+    body.flow_control().release_capacity(data.len())?;
+    return Poll::Ready(Ok(DataOrTrailers::Data(data)));
+    // If `poll_data` returns `Ready(None)`, poll one more time to check for trailers
+  }
+  // Return pending here as poll_data will keep the waker
+  Poll::Pending
 }
 
 #[op2(async)]

filename: tests/unit_node/http2_test.ts
patch: @@ -203,3 +203,43 @@ Deno.test("[node/http2 client] write image buffer on request stream works", asyn
   await endPromise.promise;
   assertEquals(receivedData!, buffer);
 });
+
+Deno.test("[node/http2 client] write 512kb buffer on request stream works", async () => {
+  const url = "https://localhost:5545";
+  const client = http2.connect(url);
+  client.on("error", (err) => console.error(err));
+
+  const filePath = join(
+    import.meta.dirname!,
+    "testdata",
+    "lorem_ipsum_512kb.txt",
+  );
+  const buffer = await readFile(filePath);
+  const req = client.request({ ":method": "POST", ":path": "/echo_server" });
+  req.write(buffer, (err) => {
+    if (err) throw err;
+  });
+
+  let receivedData: Buffer;
+  req.on("data", (chunk) => {
+    if (!receivedData) {
+      receivedData = chunk;
+    } else {
+      receivedData = Buffer.concat([receivedData, chunk]);
+    }
+  });
+  req.end();
+
+  const endPromise = Promise.withResolvers<void>();
+  setTimeout(() => {
+    try {
+      client.close();
+    } catch (_) {
+      // pass
+    }
+    endPromise.resolve();
+  }, 2000);
+
+  await endPromise.promise;
+  assertEquals(receivedData!, buffer);
+});
Repository: nodejs/node
Pull request: test: unused callback variables removed

Non used variables were removed from stream-exception test

<!--
Before submitting a pull request, please read
https://github.com/nodejs/node/blob/HEAD/CONTRIBUTING.md.

Commit message formatting guidelines:
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.

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: test/parallel/test-wrap-js-stream-exceptions.js
patch: @@ -11,7 +11,7 @@ process.once('uncaughtException', common.mustCall((err) => {
 
 const socket = new JSStreamWrap(new Duplex({
   read: common.mustCall(),
-  write: common.mustCall((buffer, data, cb) => {
+  write: common.mustCall(() => {
     throw new Error('exception!');
   })
 }));
Repository: ggml-org/llama.cpp
Pull request: llama : fix K-shift with quantized K and BLAS backend

It is not necessary to set the backend since the `ggml_cpy` operation is a view of the K tensor, so it will be forced to run on the CPU backend, and the other ops will be expanded from this.

Fixes #13112

Changed files:
filename: src/llama-context.cpp
patch: @@ -469,8 +469,7 @@ ggml_tensor * llama_context::build_rope_shift(
         ggml_tensor * shift,
         ggml_tensor * factors,
               float   freq_base,
-              float   freq_scale,
-        ggml_backend_buffer * bbuf) const {
+              float   freq_scale) const {
     const auto & n_ctx_orig = cparams.n_ctx_orig_yarn;
 
     const auto & yarn_ext_factor  = cparams.yarn_ext_factor;
@@ -492,17 +491,7 @@ ggml_tensor * llama_context::build_rope_shift(
         // dequantize to f32 -> RoPE -> quantize back
         tmp = ggml_cast(ctx0, cur, GGML_TYPE_F32);
 
-        if (bbuf) {
-            for (const auto & backend : backends) {
-                // Figure out which backend KV cache belongs to
-                if (ggml_backend_supports_buft(backend.get(), ggml_backend_buffer_get_type(bbuf))) {
-                    ggml_backend_sched_set_tensor_backend(sched.get(), tmp, backend.get());
-                    break;
-                }
-            }
-        }
-
-        tmp = ggml_rope_ext_inplace(ctx0, tmp,
+        tmp = ggml_rope_ext(ctx0, tmp,
                 shift, factors, n_rot, rope_type, n_ctx_orig, freq_base, freq_scale,
                 yarn_ext_factor, yarn_attn_factor, yarn_beta_fast, yarn_beta_slow);
 
@@ -582,7 +571,7 @@ llm_graph_result_ptr llama_context::build_kv_self_shift(
                 ggml_row_size(kv_self->k_l[il]->type, n_embd_k_gqa),
                 0);
 
-        ggml_tensor * cur = build_rope_shift(ctx0, k, inp->k_shift, rope_factors, freq_base_l, freq_scale_l, kv_self->k_l[il]->buffer);
+        ggml_tensor * cur = build_rope_shift(ctx0, k, inp->k_shift, rope_factors, freq_base_l, freq_scale_l);
 
         ggml_build_forward_expand(gf, cur);
     }

filename: src/llama-context.h
patch: @@ -170,8 +170,7 @@ struct llama_context {
         ggml_tensor * shift,
         ggml_tensor * factors,
               float   freq_base,
-              float   freq_scale,
-        ggml_backend_buffer * bbuf) const;
+              float   freq_scale) const;
 
     llm_graph_result_ptr build_kv_self_shift(
             ggml_context * ctx0,
Repository: facebook/react
Pull request: Remove "packages/shared/invariant.js"

We no longer need it after #22435.

Changed files:
filename: packages/shared/invariant.js
patch: @@ -1,26 +0,0 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- */
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-export default function invariant(condition, format, a, b, c, d, e, f) {
-  // eslint-disable-next-line react-internal/prod-error-codes
-  throw new Error(
-    'Internal React error: invariant() is meant to be replaced at compile ' +
-      'time. There is no runtime version.',
-  );
-}
Repository: huggingface/transformers
Pull request: fix(qwen): fix shape error when using tp

# fix qwen shape error when using tp


<!-- Remove if not applicable -->

Fixes #36875


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [ ] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#create-a-pull-request),
      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?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@zucchini-nlp 



Changed files:
filename: src/transformers/models/qwen2_5_vl/modeling_qwen2_5_vl.py
patch: @@ -961,7 +961,7 @@ def forward(
         )
 
         attn_output = attn_output.transpose(1, 2).contiguous()
-        attn_output = attn_output.view(bsz, q_len, self.hidden_size)
+        attn_output = attn_output.view(bsz, q_len, -1)
 
         attn_output = self.o_proj(attn_output)
 

filename: src/transformers/models/qwen2_vl/modeling_qwen2_vl.py
patch: @@ -782,7 +782,7 @@ def forward(
         )
 
         attn_output = attn_output.transpose(1, 2).contiguous()
-        attn_output = attn_output.view(bsz, q_len, self.hidden_size)
+        attn_output = attn_output.view(bsz, q_len, -1)
 
         attn_output = self.o_proj(attn_output)
Repository: electron/electron
Pull request: fix: Use XDG_ACTIVATION_TOKEN in wayland when launched by other app

Backport of #43481

See that PR for details.


Notes: Fixed electron app in ozone/wayland not being focused when launched from another app


Changed files:
filename: shell/app/electron_main_delegate.cc
patch: @@ -406,6 +406,11 @@ std::optional<int> ElectronMainDelegate::PreBrowserMain() {
   content::InitializeMojoCore();
 #if BUILDFLAG(IS_MAC)
   RegisterAtomCrApp();
+#endif
+#if BUILDFLAG(IS_LINUX)
+  // Set the global activation token sent as an environment variable.
+  auto env = base::Environment::Create();
+  base::nix::ExtractXdgActivationTokenFromEnv(*env);
 #endif
   return std::nullopt;
 }

filename: shell/browser/api/electron_api_app.cc
patch: @@ -92,6 +92,11 @@
 #include "shell/browser/ui/cocoa/electron_bundle_mover.h"
 #endif
 
+#if BUILDFLAG(IS_LINUX)
+#include "base/nix/scoped_xdg_activation_token_injector.h"
+#include "base/nix/xdg_util.h"
+#endif
+
 using electron::Browser;
 
 namespace gin {
@@ -411,6 +416,12 @@ bool NotificationCallbackWrapper(
     base::CommandLine cmd,
     const base::FilePath& cwd,
     const std::vector<uint8_t> additional_data) {
+#if BUILDFLAG(IS_LINUX)
+  // Set the global activation token sent as a command line switch by another
+  // electron app instance. This also removes the switch after use to prevent
+  // any side effects of leaving it in the command line after this point.
+  base::nix::ExtractXdgActivationTokenFromCmdLine(cmd);
+#endif
   // Make sure the callback is called after app gets ready.
   if (Browser::Get()->is_ready()) {
     callback.Run(std::move(cmd), cwd, std::move(additional_data));
@@ -1022,6 +1033,15 @@ bool App::RequestSingleInstanceLock(gin::Arguments* args) {
       base::BindRepeating(NotificationCallbackWrapper, cb));
 #endif
 
+#if BUILDFLAG(IS_LINUX)
+  // Read the xdg-activation token and set it in the command line for the
+  // duration of the notification in order to ensure this is propagated to an
+  // already running electron app instance if it exists.
+  // The activation token received from the launching app is used later when
+  // activating the existing electron app instance window.
+  base::nix::ScopedXdgActivationTokenInjector activation_token_injector(
+      *base::CommandLine::ForCurrentProcess(), *base::Environment::Create());
+#endif
   switch (process_singleton_->NotifyOtherProcessOrCreate()) {
     case ProcessSingleton::NotifyResult::PROCESS_NONE:
       if (content::BrowserThread::IsThreadInitialized(
Repository: ggml-org/llama.cpp
Pull request: Force FP32 compute in GLM4 FFN Down

See discussion in https://github.com/ggml-org/llama.cpp/issues/12946 - the new GLM4 models seems to have issues with FP16 matmul. Should be reproducible with `GGML_CUDA_FORCE_CUBLAS=1` on any card that supports FP16.

Based on the comment for `GGML_CUDA_FORCE_MMQ` in [docs/build.md](https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md#performance-tuning), this would most likely affect V100, CDNA and RDNA3+, though I only have a Volta card to test on. Unsure if anything else ever hits this specific branch of the code.

Seems like it largely affects prompt processing speed (compute bound), but unsure if there's a better way to fix this specific code path other than adding more checks.

Master:
| model                          |       size |     params | backend    | ngl |          test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------------: | -------------------: |
| glm4 32B Q6_K                  |  24.88 GiB |    32.57 B | CUDA       |  99 |         pp512 |        606.64 ± 5.58 |
| glm4 32B Q6_K                  |  24.88 GiB |    32.57 B | CUDA       |  99 |         tg128 |         15.89 ± 0.07 |
| llama 13B Q8_0                 |  12.12 GiB |    12.25 B | CUDA       |  99 |         pp512 |      1661.09 ± 80.06 |
| llama 13B Q8_0                 |  12.12 GiB |    12.25 B | CUDA       |  99 |         tg128 |         49.13 ± 0.03 |

PR:
| model                          |       size |     params | backend    | ngl |          test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | --: | ------------: | -------------------: |
| glm4 32B Q6_K                  |  24.88 GiB |    32.57 B | CUDA       |  99 |         pp512 |        513.01 ± 7.13 |
| glm4 32B Q6_K                  |  24.88 GiB |    32.57 B | CUDA       |  99 |         tg128 |         16.05 ± 0.19 |
| llama 13B Q8_0                 |  12.12 GiB |    12.25 B | CUDA       |  99 |         pp512 |      1575.93 ± 65.59 |
| llama 13B Q8_0                 |  12.12 GiB |    12.25 B | CUDA       |  99 |         tg128 |         49.48 ± 0.13 |

(Also ran `test-backend-ops`, seems ok)


Changed files:
filename: src/llama-graph.cpp
patch: @@ -803,6 +803,10 @@ ggml_tensor * llm_graph_context::build_ffn(
 
     if (down) {
         cur = build_lora_mm(down, 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 (down_b) {