helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: Fix MoE gradient test

Some MoE models get flaky failures because the gradient checkpointing test tests that all parameters have gradient, which is not true when some experts are not activated. This PR skips those tests correctly for those models.

Changed files:
filename: tests/models/phimoe/test_modeling_phimoe.py
patch: @@ -102,6 +102,7 @@ class PhimoeModelTest(CausalLMModelTest, unittest.TestCase):
 
     test_headmasking = False
     test_pruning = False
+    test_all_params_have_gradient = False
     model_tester_class = PhimoeModelTester
     pipeline_model_mapping = (
         {

filename: tests/models/qwen2_moe/test_modeling_qwen2_moe.py
patch: @@ -83,6 +83,7 @@ class Qwen2MoeModelTest(CausalLMModelTest, unittest.TestCase):
 
     test_headmasking = False
     test_pruning = False
+    test_all_params_have_gradient = False
     model_tester_class = Qwen2MoeModelTester
 
     # TODO (ydshieh): Check this. See https://app.circleci.com/pipelines/github/huggingface/transformers/79245/workflows/9490ef58-79c2-410d-8f51-e3495156cf9c/jobs/1012146

filename: tests/models/qwen3_moe/test_modeling_qwen3_moe.py
patch: @@ -82,6 +82,7 @@ class Qwen3MoeModelTest(CausalLMModelTest, unittest.TestCase):
 
     test_headmasking = False
     test_pruning = False
+    test_all_params_have_gradient = False
     model_tester_class = Qwen3MoeModelTester
 
     # TODO (ydshieh): Check this. See https://app.circleci.com/pipelines/github/huggingface/transformers/79245/workflows/9490ef58-79c2-410d-8f51-e3495156cf9c/jobs/1012146
Repository: denoland/deno
Pull request: fix(fmt): fix several HTML and components issues

Fix #26245 
Close #26324 
Fix #26508 
Fix #26540 
Fix #26562 

Changed files:
filename: .dprint.json
patch: @@ -68,7 +68,7 @@
     "third_party"
   ],
   "plugins": [
-    "https://plugins.dprint.dev/typescript-0.93.0.wasm",
+    "https://plugins.dprint.dev/typescript-0.93.1.wasm",
     "https://plugins.dprint.dev/json-0.19.4.wasm",
     "https://plugins.dprint.dev/markdown-0.17.8.wasm",
     "https://plugins.dprint.dev/toml-0.6.3.wasm",

filename: Cargo.lock
patch: @@ -4311,9 +4311,9 @@ dependencies = [
 
 [[package]]
 name = "markup_fmt"
-version = "0.14.0"
+version = "0.15.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f15d7b24ae4ea9b87279bc0696462a4fb6c2168847f2cc162a2da05fe1a0f61"
+checksum = "ebae65c91eab3d42231232bf48107f351e5a8d511454927218c53aeb68bbdb6f"
 dependencies = [
  "aho-corasick",
  "css_dataset",

filename: cli/Cargo.toml
patch: @@ -129,7 +129,7 @@ libz-sys.workspace = true
 log = { workspace = true, features = ["serde"] }
 lsp-types.workspace = true
 malva = "=0.11.0"
-markup_fmt = "=0.14.0"
+markup_fmt = "=0.15.0"
 memmem.workspace = true
 monch.workspace = true
 notify.workspace = true
Repository: huggingface/transformers
Pull request: Fix flaky `SwitchTransformersModelTest::test_training_gradient`

# What does this PR do?

Not all experts will get grad in a forward call.

Changed files:
filename: tests/models/switch_transformers/test_modeling_switch_transformers.py
patch: @@ -576,6 +576,8 @@ class SwitchTransformersModelTest(ModelTesterMixin, GenerationTesterMixin, Pipel
     test_torchscript = False
     # The small SWITCH_TRANSFORMERS model needs higher percentages for CPU/MP tests
     model_split_percents = [0.5, 0.8, 0.9]
+    # `SwitchTransformers` is a MOE in which not all experts will get gradients because they are not all used in a single forward pass
+    test_all_params_have_gradient = False
 
     def setUp(self):
         self.model_tester = SwitchTransformersModelTester(self)

filename: tests/test_modeling_common.py
patch: @@ -221,6 +221,8 @@ class ModelTesterMixin:
     test_mismatched_shapes = True
     test_missing_keys = True
     test_model_parallel = False
+    # Used in `check_training_gradient_checkpointing` to NOT check all params having gradient (e.g. for some MOE models)
+    test_all_params_have_gradient = True
     is_encoder_decoder = False
     has_attentions = True
     _is_composite = False
@@ -895,9 +897,10 @@ def check_training_gradient_checkpointing(self, gradient_checkpointing_kwargs=No
                 loss.backward()
                 optimizer.step()
 
-                for k, v in model.named_parameters():
-                    if v.requires_grad:
-                        self.assertTrue(v.grad is not None, f"{k} in {model_class.__name__} has no gradient!")
+                if self.test_all_params_have_gradient:
+                    for k, v in model.named_parameters():
+                        if v.requires_grad:
+                            self.assertTrue(v.grad is not None, f"{k} in {model_class.__name__} has no gradient!")
 
     def test_training(self):
         if not self.model_tester.is_training:
Repository: electron/electron
Pull request: fix: keep gdk_pixbuf a dynamic dependency

#### Description of Change

We made gdk_pixbuf a dynamic dependency since https://github.com/electron/electron/pull/34077 to help with downstream packaging due to conflicting names of the source package in various distros. The dependency regressed recently via https://github.com/electron/electron/pull/43956 which missed adding required symbols to the stubs.

A good regression test to catch future breakages would be to run https://source.chromium.org/chromium/chromium/src/+/main:third_party/dpkg-shlibdeps/dpkg-shlibdeps.pl and ensure the dependency doesn't show up. If this sounds good I can port a version of https://github.com/microsoft/vscode/blob/a14300ec9f7d04fbbaa9f896d46626110baa2b90/build/linux/debian/calculate-deps.ts#L21-L97 in a follow-up PR

New stub declarations are taken from https://docs.gtk.org/gdk-pixbuf/

#### Release Notes

Notes: fix regression with dynamic dependency on `libgdk_pixbuf`

Changed files:
filename: shell/browser/ui/electron_gdk_pixbuf.sigs
patch: @@ -1,3 +1,4 @@
-GdkPixbuf* gdk_pixbuf_new(GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height)
+GdkPixbuf* gdk_pixbuf_new_from_bytes(GBytes* data, GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height, int rowstride)
 GdkPixbuf* gdk_pixbuf_scale_simple(const GdkPixbuf* src, int dest_width, int dest_height, GdkInterpType interp_type)
-guchar* gdk_pixbuf_get_pixels(const GdkPixbuf* pixbuf)
+GdkPixbuf* gdk_pixbuf_new_from_file_at_size(const char* filename, int width, int height, GError** error);
+gint gdk_pixbuf_calculate_rowstride(GdkColorspace colorspace, gboolean has_alpha, int bits_per_sample, int width, int height)
Repository: facebook/react
Pull request: Remove resolutions from test renderer package.json

This doesn't do anything. They're only taken into account in the top-level package.json AFAIK.

Changed files:
filename: packages/react-test-renderer/package.json
patch: @@ -27,9 +27,6 @@
   "peerDependencies": {
     "react": "^17.0.0-alpha"
   },
-  "resolutions": {
-    "react-shallow-renderer/react-is": "^17.0.0-alpha"
-  },
   "files": [
     "LICENSE",
     "README.md",
Repository: ggml-org/llama.cpp
Pull request: server : fix assistant prefilling when content is an array

Assistant prefilling did not account for content as an array.

Changed files:
filename: tools/server/tests/unit/test_chat_completion.py
patch: @@ -132,6 +132,28 @@ def test_chat_template():
     assert res.body["__verbose"]["prompt"] == "
 
system
\n\nBook

user
\n\nWhat is the best book

assistant
\n\n"
 
 
+@pytest.mark.parametrize("prefill,re_prefill", [
+    ("Whill", "Whill"),
+    ([{"type": "text", "text": "Wh"}, {"type": "text", "text": "ill"}], "Whill"),
+])
+def test_chat_template_assistant_prefill(prefill, re_prefill):
+    global server
+    server.chat_template = "llama3"
+    server.debug = True  # to get the "__verbose" object in the response
+    server.start()
+    res = server.make_request("POST", "/chat/completions", data={
+        "max_tokens": 8,
+        "messages": [
+            {"role": "system", "content": "Book"},
+            {"role": "user", "content": "What is the best book"},
+            {"role": "assistant", "content": prefill},
+        ]
+    })
+    assert res.status_code == 200
+    assert "__verbose" in res.body
+    assert res.body["__verbose"]["prompt"] == f"
 
system
\n\nBook

user
\n\nWhat is the best book

assistant
\n\n{re_prefill}"
+
+
 def test_apply_chat_template():
     global server
     server.chat_template = "command-r"
@@ -228,6 +250,7 @@ def test_completion_with_grammar(jinja: bool, grammar: str, n_predicted: int, re
     [{"role": "system", "content": 123}],
     # [{"content": "hello"}], # TODO: should not be a valid case
     [{"role": "system", "content": "test"}, {}],
+    [{"role": "user", "content": "test"}, {"role": "assistant", "content": "test"}, {"role": "assistant", "content": "test"}],
 ])
 def test_invalid_chat_completion_req(messages):
     global server

filename: tools/server/utils.hpp
patch: @@ -792,7 +792,13 @@ static json oaicompat_chat_params_parse(
 
     /* Append assistant prefilled message */
     if (prefill_assistant_message) {
-         chat_params.prompt += last_message.content;
+        if (!last_message.content_parts.empty()) {
+            for (auto & p : last_message.content_parts) {
+                chat_params.prompt += p.text;
+            }
+        } else {
+            chat_params.prompt += last_message.content;
+        }
     }
 
     llama_params["chat_format"]      = static_cast<int>(chat_params.format);
Repository: huggingface/transformers
Pull request: Remove redundant test_sdpa_equivalence test

#37911 removed a redundant and failing test, but I accidentally added it back in #37590 because they were both open at the same time. This PR removes it again, sorry about that!

Changed files:
filename: tests/causal_lm_tester.py
patch: @@ -22,9 +22,7 @@
 from transformers.testing_utils import (
     is_flaky,
     require_flash_attn,
-    require_torch_accelerator,
     require_torch_gpu,
-    require_torch_sdpa,
     slow,
 )
 
@@ -410,39 +408,6 @@ def test_model_rope_scaling(self):
         with self.assertRaises(AssertionError):
             torch.testing.assert_close(yarn_sin_long, original_sin_long)
 
-    @require_torch_sdpa
-    @require_torch_accelerator
-    @slow
-    def test_sdpa_equivalence(self):
-        for model_class in self.all_model_classes:
-            if not model_class._supports_sdpa:
-                self.skipTest(reason="Model does not support SDPA")
-
-            config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()
-            model = model_class(config)
-
-            with tempfile.TemporaryDirectory() as tmpdirname:
-                model.save_pretrained(tmpdirname)
-                model_sdpa = model_class.from_pretrained(
-                    tmpdirname, torch_dtype=torch.bfloat16, attn_implementation="sdpa"
-                )
-                model_sdpa.to(torch_device)
-
-                model = model_class.from_pretrained(
-                    tmpdirname, torch_dtype=torch.bfloat16, attn_implementation="eager"
-                )
-                model.to(torch_device)
-
-                dummy_input = inputs_dict[model_class.main_input_name]
-                dummy_input = dummy_input.to(torch_device)
-                outputs = model(dummy_input, output_hidden_states=True)
-                outputs_sdpa = model_sdpa(dummy_input, output_hidden_states=True)
-
-                logits = outputs.hidden_states[-1]
-                logits_sdpa = outputs_sdpa.hidden_states[-1]
-
-                assert torch.allclose(logits_sdpa, logits, atol=2e-3)
-
     @require_flash_attn
     @require_torch_gpu
     @pytest.mark.flash_attn_test
Repository: vercel/next.js
Pull request: Generate deterministic requestId for SSG

Use a deterministic requestId so that this code has a deterministic key and thus a deterministic RSC payload to generate deterministic SSG output.
```javascript
            {/* Adding requestId as react key to make metadata remount for each render */}
            <ViewportTree key={getFlightViewportKey(requestId)} />
```

This was previously changing on every run:

<img width="1398" alt="Bildschirmfoto 2025-05-30 um 10 45 08" src="https://github.com/user-attachments/assets/36cb9864-9b27-4107-93d6-689c9d147e86" />


Closes PACK-4716

Changed files:
filename: packages/next/src/server/app-render/app-render.tsx
patch: @@ -1331,13 +1331,19 @@ async function renderToHTMLOrFlightImpl(
     nonce,
   } = parsedRequestHeaders
 
+  const { isStaticGeneration, fallbackRouteParams } = workStore
+
   /**
    * The metadata items array created in next-app-loader with all relevant information
    * that we need to resolve the final metadata.
    */
   let requestId: string
 
-  if (process.env.NEXT_RUNTIME === 'edge') {
+  if (isStaticGeneration) {
+    requestId = Buffer.from(
+      await crypto.subtle.digest('SHA-1', Buffer.from(req.url))
+    ).toString('hex')
+  } else if (process.env.NEXT_RUNTIME === 'edge') {
     requestId = crypto.randomUUID()
   } else {
     requestId = require('next/dist/compiled/nanoid').nanoid()
@@ -1348,8 +1354,6 @@ async function renderToHTMLOrFlightImpl(
    */
   const params = renderOpts.params ?? {}
 
-  const { isStaticGeneration, fallbackRouteParams } = workStore
-
   const getDynamicParamFromSegment = makeGetDynamicParamFromSegment(
     params,
     pagePath,
Repository: facebook/react
Pull request: Revert "Fix mistyped script arbitrary code execution vulnerability"

Reverts facebook/react#18660

This is not a "vulnerability".

If the attacker controls the tag name, then they can just give you `<script>` instead. So this is not protecting from any actual attack.

We have a warning if you try to use non-lowercase characters in the type. This is not supported. So the semantics there are undefined. They don't have to be consistent. You're on your own if you ignore warnings.

Moreover, even a regular `<script>` will execute if you do SSR. So generally, if you don't want them to execute, you shouldn't be putting `<script>` in your components.

The motivation of the revert is to remove otherwise-unnecessary `toLowerCase` from the production path for every element.

Changed files:
filename: packages/react-dom/src/client/ReactDOMComponent.js
patch: @@ -430,13 +430,11 @@ export function createElement(
     namespaceURI = getIntrinsicNamespace(type);
   }
   if (namespaceURI === HTML_NAMESPACE) {
-    const lowerCaseType = type.toLowerCase();
-
     if (__DEV__) {
       isCustomComponentTag = isCustomComponent(type, props);
       // Should this check be gated by parent namespace? Not sure we want to
       // allow <SVG> or <mATH>.
-      if (!isCustomComponentTag && type !== lowerCaseType) {
+      if (!isCustomComponentTag && type !== type.toLowerCase()) {
         console.error(
           '<%s /> is using incorrect casing. ' +
             'Use PascalCase for React components, ' +
@@ -446,7 +444,7 @@ export function createElement(
       }
     }
 
-    if (lowerCaseType === 'script') {
+    if (type === 'script') {
       // Create the script via .innerHTML so its "parser-inserted" flag is
       // set to true and it does not execute
       const div = ownerDocument.createElement('div');

filename: packages/react-dom/src/client/__tests__/trustedTypes-test.internal.js
patch: @@ -242,20 +242,4 @@ describe('when Trusted Types are available in global object', () => {
     // check that the warning is printed only once
     ReactDOM.render(<script>alert("I am not executed")</script>, container);
   });
-
-  it('should warn twice when rendering scRipt tag and prevent code execution on mistyped tag', () => {
-    expect(() => {
-      ReactDOM.render(<scRipt>alert("I am not executed")</scRipt>, container);
-    }).toErrorDev([
-      'Warning: <scRipt /> is using incorrect casing. ' +
-        'Use PascalCase for React components, ' +
-        'or lowercase for HTML elements.\n' +
-        '    in scRipt (at **)',
-      'Warning: Encountered a script tag while rendering React component. ' +
-        'Scripts inside React components are never executed when rendering ' +
-        'on the client. Consider using template tag instead ' +
-        '(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).\n' +
-        '    in scRipt (at **)',
-    ]);
-  });
 });
Repository: denoland/deno
Pull request: fix: remove permission check in op_require_node_module_paths

I don't see the need for this? It's just joining paths?

Changed files:
filename: ext/node/ops/require.rs
patch: @@ -131,9 +131,6 @@ where
     normalize_path(current_dir.join(from))
   };
 
-  let from = ensure_read_permission::<P>(state, &from)
-    .map_err(RequireError::Permission)?;
-
   if cfg!(windows) {
     // return root node_modules when path is 'D:\\'.
     let from_str = from.to_str().unwrap();
@@ -154,7 +151,7 @@ where
   }
 
   let mut paths = Vec::with_capacity(from.components().count());
-  let mut current_path = from.as_ref();
+  let mut current_path = from.as_path();
   let mut maybe_parent = Some(current_path);
   while let Some(parent) = maybe_parent {
     if !parent.ends_with("node_modules") {
Repository: ggml-org/llama.cpp
Pull request: eval-callback : check for empty input

fix #14537

Changed files:
filename: examples/eval-callback/eval-callback.cpp
patch: @@ -136,6 +136,11 @@ static bool run(llama_context * ctx, const common_params & params) {
 
     std::vector<llama_token> tokens = common_tokenize(ctx, params.prompt, add_bos);
 
+    if (tokens.empty()) {
+        LOG_ERR("%s : there are not input tokens to process - (try to provide a prompt with '-p')\n", __func__);
+        return false;
+    }
+
     if (llama_decode(ctx, llama_batch_get_one(tokens.data(), tokens.size()))) {
         LOG_ERR("%s : failed to eval\n", __func__);
         return false;
Repository: vercel/next.js
Pull request: Fix incorrect route param

In the example under the "Generated Metadata" section of the page, the route is defined as `/app/blog/[slug]/page.tsx`, but the Props type uses `id` instead of `slug`. This fixes the mismatch to reflect the actual dynamic route segment

Changed files:
filename: docs/01-app/01-getting-started/13-metadata-and-og-images.mdx
patch: @@ -72,7 +72,7 @@ You can use [`generateMetadata`](/docs/app/api-reference/functions/generate-meta
 import type { Metadata, ResolvingMetadata } from 'next'
 
 type Props = {
-  params: Promise<{ id: string }>
+  params: Promise<{ slug: string }>
   searchParams: Promise<{ [key: string]: string | string[] | undefined }>
 }
Repository: nodejs/node
Pull request: doc: update testing documentation

This update improves the [test/common/README.md](https://github.com/nodejs/node/blob/1b2d2f7e682268228b1352cba7389db01614812a/test/common/README.md) file by explaining why the common module is essential when writing tests.

I became curious about its importance while working on [PR #56942](https://github.com/nodejs/node/pull/56942), and @joyeecheung kindly provided the additional context that was missing from the documentation. :)

Changed files:
filename: test/common/README.md
patch: @@ -1,6 +1,29 @@
 # Node.js Core Test Common Modules
 
 This directory contains modules used to test the Node.js implementation.
+All tests must begin by requiring the `common` module:
+
+```js
+require('../common');
+```
+
+This is not just a convenience for exporting helper functions etc; it also performs
+several other tasks:
+
+* Verifies that no unintended globals have been leaked to ensure that tests
+  don't accidentally pollute the global namespace.
+
+* Some tests assume a default umask of `0o022`. To enforce this assumption,
+  the common module sets the unmask at startup. Tests that require a
+  different umask can override this setting after loading the module.
+
+* Some tests specify runtime flags (example, `--expose-internals`) via a
+  comment at the top of the file: `// Flags: --expose-internals`.
+  If the test is run without those flags, the common module automatically
+  spawns a child process with proper flags. This ensures that the tests
+  always run under the expected conditions. Because of this behaviour, the
+  common module must be loaded first so that any code below it is not
+  executed until the process has been re-spawned with the correct flags.
 
 ## Table of contents
Repository: ggml-org/llama.cpp
Pull request: metal : disable fast math in all quantize kernels

cont #14460 

Changed files:
filename: ggml/src/ggml-metal/ggml-metal.metal
patch: @@ -109,6 +109,7 @@ void dequantize_q4_0_t4(device const block_q4_0 * xb, short il, thread type4 & r
 }
 
 void quantize_q4_0(device const float * src, device block_q4_0 & dst) {
+#pragma METAL fp math_mode(safe)
     float amax = 0.0f; // absolute max
     float max  = 0.0f;
 
@@ -167,6 +168,7 @@ void quantize_q4_1(device const float * src, device block_q4_1 & dst) {
 }
 
 void quantize_q5_0(device const float * src, device block_q5_0 & dst) {
+#pragma METAL fp math_mode(safe)
     float amax = 0.0f; // absolute max
     float max  = 0.0f;
 
@@ -461,6 +463,7 @@ void dequantize_q8_0_t4(device const block_q8_0 *xb, short il, thread type4 & re
 }
 
 void quantize_q8_0(device const float * src, device block_q8_0 & dst) {
+#pragma METAL fp math_mode(safe)
     float amax = 0.0f; // absolute max
 
     for (int j = 0; j < QK8_0; j++) {
Repository: denoland/deno
Pull request: fix(ext/node): return `this` from `http.Server.ref/unref()`

Fixes https://github.com/denoland/deno/issues/26642

Changed files:
filename: ext/node/polyfills/http.ts
patch: @@ -1802,13 +1802,17 @@ export class ServerImpl extends EventEmitter {
       this.#server.ref();
     }
     this.#unref = false;
+
+    return this;
   }
 
   unref() {
     if (this.#server) {
       this.#server.unref();
     }
     this.#unref = true;
+
+    return this;
   }
 
   close(cb?: (err?: Error) => void): this {
Repository: denoland/deno
Pull request: fix(serve): support serve hmr

This PR addresses issue #25600 

Changes:
Updated `fn has_hmr` to check `serve` subcommand and return its hmr value if found, in order to run the worker in serve mode with hmr_runner. Thus the hmr event can be dispatched upon changes on the file served.

Changed files:
filename: cli/args/mod.rs
patch: @@ -1452,6 +1452,12 @@ impl CliOptions {
       watch: Some(WatchFlagsWithPaths { hmr, .. }),
       ..
     }) = &self.flags.subcommand
+    {
+      *hmr
+    } else if let DenoSubcommand::Serve(ServeFlags {
+      watch: Some(WatchFlagsWithPaths { hmr, .. }),
+      ..
+    }) = &self.flags.subcommand
     {
       *hmr
     } else {

filename: cli/tools/serve.rs
patch: @@ -44,12 +44,15 @@ pub async fn serve(
   maybe_npm_install(&factory).await?;
 
   let worker_factory = factory.create_cli_main_worker_factory().await?;
-
+  let hmr = serve_flags
+    .watch
+    .map(|watch_flags| watch_flags.hmr)
+    .unwrap_or(false);
   do_serve(
     worker_factory,
     main_module.clone(),
     serve_flags.worker_count,
-    false,
+    hmr,
   )
   .await
 }
@@ -109,8 +112,6 @@ async fn do_serve(
     }
   }
   Ok(exit_code)
-
-  // main.await?
 }
 
 async fn run_worker(
@@ -119,7 +120,7 @@ async fn run_worker(
   main_module: ModuleSpecifier,
   hmr: bool,
 ) -> Result<i32, AnyError> {
-  let mut worker = worker_factory
+  let mut worker: crate::worker::CliMainWorker = worker_factory
     .create_main_worker(
       deno_runtime::WorkerExecutionMode::Serve {
         is_main: false,