helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: from_pretrained should handle xpu case


 @SunMarc @zach-huggingface

please help review. find the issue when inference meta-llama/Llama-4-Scout-17B-16E in TGI. while TGI use FLASH_TRANSFORMERS_BACKEND for llama4.


Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -3989,6 +3989,9 @@ def from_pretrained(
                     elif device_type == "cpu":
                         cpu_backend = "ccl" if int(os.environ.get("CCL_WORKER_COUNT", 0)) else "gloo"
                         torch.distributed.init_process_group(cpu_backend, rank=rank, world_size=world_size)
+                    elif device_type == "xpu":
+                        torch.distributed.init_process_group("ccl", rank=rank, world_size=world_size)
+                        torch.xpu.set_device(int(os.environ["LOCAL_RANK"]))
 
                 except Exception as e:
                     raise EnvironmentError(
@@ -3997,7 +4000,10 @@ def from_pretrained(
                     ) from e
 
             # Get device with index assuming equal number of devices per host
-            index = None if device_type == "cpu" else torch.cuda.current_device()
+            if device_type == "xpu":
+                index = torch.xpu.current_device()
+            else:
+                index = None if device_type == "cpu" else torch.cuda.current_device()
             tp_device = torch.device(device_type, index)
 
             if index is not None and index > 0:
Repository: vuejs/vue
Pull request: Typo fix

'reprository' -> 'repository'


Changed files:
filename: issue_template.md
patch: @@ -37,7 +37,7 @@ Remove the template from below and provide thoughtful commentary *and code sampl
 1.0.23
 
 ### Reproduction Link
-<!-- A minimal JSBin, JSFiddle, Codepen, or a GitHub reprository that can reproduce the bug. -->
+<!-- A minimal JSBin, JSFiddle, Codepen, or a GitHub repository that can reproduce the bug. -->
 
 ### Steps to reproduce
Repository: facebook/react
Pull request: Allow `<script>` and `<template>` tags in `<select>` tag

## Summary

As per https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inselect, `<script>` and `<template>` tags may be nested in a `<select>` tag.  This PR modifies `isTagValidWithParent` to allow that.

## How did you test this change?

Based on #27632 (a similar PR), I did not add a test.  I noticed that all the tests in [`validateDOMNesting-test.js`](https://github.com/facebook/react/blob/1e9ef39a8742889f8414c7df9c9e6ef463fe3d01/packages/react-dom/src/__tests__/validateDOMNesting-test.js) are negative tests (i.e. expect warnings), not positive tests (i.e. expect no warnings), so I assume this is preferred.  But I can add a test, if desired.


Changed files:
filename: packages/react-dom-bindings/src/client/validateDOMNesting.js
patch: @@ -297,6 +297,8 @@ function isTagValidWithParent(tag: string, parentTag: ?string): boolean {
         tag === 'hr' ||
         tag === 'option' ||
         tag === 'optgroup' ||
+        tag === 'script' ||
+        tag === 'template' ||
         tag === '#text'
       );
     case 'optgroup':
Repository: nodejs/node
Pull request: src: use cached primordials_string

Use cached `primordials` string from IsolateData and pass isolate_data to GetPerContextExports() to avoid unnecessary string creation and keep the bootstrap path consistent.

No functional change.

Changed files:
filename: src/api/environment.cc
patch: @@ -866,8 +866,7 @@ Maybe<void> InitializePrimordials(Local<Context> context,
   if (!GetPerContextExports(context).ToLocal(&exports)) {
     return Nothing<void>();
   }
-  Local<String> primordials_string =
-      FIXED_ONE_BYTE_STRING(isolate, "primordials");
+  Local<String> primordials_string = isolate_data->primordials_string();
   // Ensure that `InitializePrimordials` is called exactly once on a given
   // context.
   CHECK(!exports->Has(context, primordials_string).FromJust());
Repository: ggml-org/llama.cpp
Pull request: ggml-zdnn: Mark zDNN buffers as non-host

While buffers reside in host memory,
additional transformation is needed to use buffers with zDNN.

This transformation was missing when using direct io.
Marking buffers as non-host forces use of ggml_backend_tensor_set function,
which in turn properly initializes and transforms buffers.

Fixes #18848


Changed files:
filename: ggml/src/ggml-zdnn/ggml-zdnn.cpp
patch: @@ -372,7 +372,8 @@ static size_t ggml_backend_zdnn_buffer_type_get_alignment(ggml_backend_buffer_ty
 }
 
 static bool ggml_backend_zdnn_buffer_type_is_host(ggml_backend_buffer_type_t buft) {
-    return true;
+    /* while it resides in host memory, additional transformation is needed */
+    return false;
 
     GGML_UNUSED(buft);
 }
Repository: vercel/next.js
Pull request: Turbopack: Remove `non_operation_vc_strongly_consistent` feature usage from next-api

This feature exists because we have some tests that aren't using the proper `OperationVc` APIs yet. It's documented that it should not be used in new code: https://github.com/search?q=repo%3Avercel%2Fnext.js%20non_operation_vc_strongly_consistent&type=code

This feature usage was added for some HMR benchmarks which were later removed. I added a comment to that PR here: https://github.com/vercel/next.js/pull/80219#discussion_r2143787319 (but it was after the PR merged)

The feature lets you strongly-consistently read or resolve a normal `Vc`. This API predates the `OperationVc` type, and is a footgun because if the `Vc` is already resolved, there's no meaningful way to read or resolve it with strong consistency.

Changed files:
filename: crates/next-api/Cargo.toml
patch: @@ -27,7 +27,7 @@ serde_json = { workspace = true }
 swc_core = { workspace = true }
 tracing = { workspace = true }
 turbo-rcstr = { workspace = true }
-turbo-tasks = { workspace = true, features = ["non_operation_vc_strongly_consistent"] }
+turbo-tasks = { workspace = true }
 turbo-tasks-env = { workspace = true }
 turbo-tasks-fs = { workspace = true }
 turbo-unix-path = { workspace = true }
Repository: huggingface/transformers
Pull request: fix speecht5 failure issue in test_peft_gradient_checkpointing_enable…

…_disable

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

Fixes # (issue)
https://github.com/huggingface/transformers/issues/33527


- speech models: @ylacombe, @eustlb


Changed files:
filename: src/transformers/models/speecht5/modeling_speecht5.py
patch: @@ -2114,7 +2114,7 @@ def get_input_embeddings(self):
             return self.encoder.get_input_embeddings()
         if isinstance(self.decoder, SpeechT5DecoderWithTextPrenet):
             return self.decoder.get_input_embeddings()
-        return None
+        raise NotImplementedError
 
     def set_input_embeddings(self, value):
         if isinstance(self.encoder, SpeechT5EncoderWithTextPrenet):

filename: tests/models/speecht5/test_modeling_speecht5.py
patch: @@ -237,12 +237,6 @@ def test_torchscript_output_hidden_state(self):
     def test_torchscript_simple(self):
         pass
 
-    @unittest.skip(
-        reason="Model returns None for input_embeds, check: https://github.com/huggingface/transformers/issues/33527"
-    )
-    def test_peft_gradient_checkpointing_enable_disable(self):
-        pass
-
 
 @require_torch
 class SpeechT5ForSpeechToTextTester:
@@ -1741,12 +1735,6 @@ def test_training_gradient_checkpointing_use_reentrant(self):
     def test_training_gradient_checkpointing_use_reentrant_false(self):
         pass
 
-    @unittest.skip(
-        reason="Model returns None for input_embeds, check: https://github.com/huggingface/transformers/issues/33527"
-    )
-    def test_peft_gradient_checkpointing_enable_disable(self):
-        pass
-
     # overwrite from test_modeling_common
     def _mock_init_weights(self, module):
         if hasattr(module, "weight") and module.weight is not None:
Repository: electron/electron
Pull request: fix: initialze featurelist before parsing features

Backport of #48411

See that PR for details.


Notes: fix crash when passing feature param from commandline `--enable-features=Feature:ParamA/Value`

Changed files:
filename: shell/app/electron_main_delegate.cc
patch: @@ -13,10 +13,12 @@
 #include "base/apple/bundle_locations.h"
 #include "base/base_switches.h"
 #include "base/command_line.h"
+#include "base/debug/leak_annotations.h"
 #include "base/debug/stack_trace.h"
 #include "base/environment.h"
 #include "base/files/file_util.h"
 #include "base/logging.h"
+#include "base/metrics/field_trial.h"
 #include "base/path_service.h"
 #include "base/strings/cstring_view.h"
 #include "base/strings/string_number_conversions.cc"
@@ -419,6 +421,11 @@ std::optional<int> ElectronMainDelegate::PreBrowserMain() {
   // This is initialized early because the service manager reads some feature
   // flags and we need to make sure the feature list is initialized before the
   // service manager reads the features.
+  if (!base::FieldTrialList::GetInstance()) {
+    base::FieldTrialList* leaked_field_trial_list = new base::FieldTrialList();
+    ANNOTATE_LEAKING_OBJECT_PTR(leaked_field_trial_list);
+    std::ignore = leaked_field_trial_list;
+  }
   InitializeFeatureList();
   // Initialize mojo core as soon as we have a valid feature list
   content::InitializeMojoCore();

filename: shell/browser/electron_browser_main_parts.cc
patch: @@ -14,7 +14,6 @@
 #include "base/command_line.h"
 #include "base/feature_list.h"
 #include "base/i18n/rtl.h"
-#include "base/metrics/field_trial.h"
 #include "base/nix/xdg_util.h"
 #include "base/path_service.h"
 #include "base/run_loop.h"
@@ -205,7 +204,6 @@ int ElectronBrowserMainParts::GetExitCode() const {
 }
 
 int ElectronBrowserMainParts::PreEarlyInitialization() {
-  field_trial_list_ = std::make_unique<base::FieldTrialList>();
 #if BUILDFLAG(IS_POSIX)
   HandleSIGCHLD();
 #endif

filename: shell/browser/electron_browser_main_parts.h
patch: @@ -19,10 +19,6 @@
 class BrowserProcessImpl;
 class IconManager;
 
-namespace base {
-class FieldTrialList;
-}
-
 namespace display {
 class Screen;
 class ScopedNativeScreen;
@@ -171,7 +167,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
   std::unique_ptr<Browser> browser_;
 
   std::unique_ptr<IconManager> icon_manager_;
-  std::unique_ptr<base::FieldTrialList> field_trial_list_;
 
 #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
   std::unique_ptr<ElectronExtensionsClient> extensions_client_;
Repository: vuejs/vue
Pull request: [2.0] [vuejs:next] add "body" as reservedTag

fix "[Vue warn]: Unknown custom element: `<body>` - did you register the component correctly? ..."


Changed files:
filename: src/platforms/web/util/element.js
patch: @@ -9,7 +9,7 @@ export const namespaceMap = {
 }
 
 export const isReservedTag = makeMap(
-  'html,base,head,link,meta,style,title,' +
+  'html,body,base,head,link,meta,style,title,' +
   'address,article,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
   'div,dd,dl,dt,figcaption,figure,hr,img,li,main,ol,p,pre,ul,' +
   'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
Repository: nodejs/node
Pull request: doc: update decorator documentation to reflect actual policy

   ## Description
   Updates the TypeScript documentation to accurately reflect Node.js's policy on decorators.

   ## Changes
   - Removes misleading "will soon be supported" language
   - Removes "temporary limitation" claim  
   - Clarifies that Node.js will not provide polyfills
   - States that decorators will be supported when implemented natively in JavaScript.

   ## Related Issue
   Fixes #60282

Changed files:
filename: doc/api/typescript.md
patch: @@ -158,10 +158,10 @@ namespace A {
 }
 ```
 
-Since Decorators are currently a [TC39 Stage 3 proposal](https://github.com/tc39/proposal-decorators)
-and will soon be supported by the JavaScript engine,
+Since Decorators are currently a [TC39 Stage 3 proposal](https://github.com/tc39/proposal-decorators),
 they are not transformed and will result in a parser error.
-This is a temporary limitation and will be resolved in the future.
+Node.js does not provide polyfills and thus will not support decorators until
+they are supported natively in JavaScript.
 
 In addition, Node.js does not read `tsconfig.json` files and does not support
 features that depend on settings within `tsconfig.json`, such as paths or
Repository: vuejs/vue
Pull request: Fix links for Statamic and No Divide Studio


Changed files:
filename: backers.md
patch: @@ -50,11 +50,11 @@ It could be you!
   <img width="200px" src="http://assets.invoicemachine.com/images/flat_logo.png">
 </a>
 
-<a href="https://statamic.com/"></a>
+<a href="https://statamic.com/">
   <img width="240px" src="http://i.imgur.com/MRIkKgp.png">
 </a>
 
-<a href="http://nodividestudio.com/"></a>
+<a href="http://nodividestudio.com/">
   <img width="100px" src="https://cloud.githubusercontent.com/assets/499550/16464256/552c2306-3e07-11e6-867f-e4f5ac64bace.png"> No Divide Studio
 </a>
Repository: ollama/ollama
Pull request: Remove out of space test temporarily

Removes the out of space test which won't trigger on CI – I wasn't sure if there was a good way to actually test this since it would involve creating a subprocess in the unit tests

Changed files:
filename: server/sched_test.go
patch: @@ -7,7 +7,6 @@ import (
 	"fmt"
 	"log/slog"
 	"os"
-	"runtime"
 	"testing"
 	"time"
 
@@ -356,42 +355,6 @@ func TestRequestsMultipleLoadedModels(t *testing.T) {
 	s.loadedMu.Unlock()
 }
 
-func TestRequestsModelTooBigForSystem(t *testing.T) {
-	ctx, done := context.WithTimeout(context.Background(), 500*time.Millisecond)
-	defer done()
-	s := InitScheduler(ctx)
-	s.getGpuFn = func() gpu.GpuInfoList {
-		g := gpu.GpuInfo{Library: "metal"}
-		g.TotalMemory = 4 * format.MebiByte
-		g.FreeMemory = 3 * format.MebiByte
-		return []gpu.GpuInfo{g}
-	}
-
-	s.getCpuFn = func() gpu.GpuInfoList {
-		g := gpu.GpuInfo{Library: "cpu"}
-		g.TotalMemory = 4 * format.MebiByte
-		g.FreeMemory = 2 * format.MebiByte
-		return []gpu.GpuInfo{g}
-	}
-	a := newScenarioRequest(t, ctx, "ollama-model-1", 10, &api.Duration{Duration: 5 * time.Millisecond})
-
-	s.newServerFn = a.newServer
-	slog.Info("a")
-	s.pendingReqCh <- a.req
-	require.Len(t, s.pendingReqCh, 1)
-	s.Run(ctx)
-	select {
-	case <-a.req.successCh:
-		if runtime.GOOS == "linux" {
-			t.Fatal("request should have been rejected with out of space")
-		}
-		// else - Darwin and Windows don't reject right now
-	case err := <-a.req.errCh:
-		require.Contains(t, err.Error(), "too large")
-	case <-ctx.Done():
-		t.Fatal("timeout")
-	}
-}
 func TestGetRunner(t *testing.T) {
 	ctx, done := context.WithTimeout(context.Background(), 100*time.Millisecond)
 	defer done()
Repository: ggml-org/llama.cpp
Pull request: Add Devstral-2 (Ministral3ForCausalLM) architeture to  convert_hf_to_gguf.py

This adds support for newer architectures like Devstral-2 (addresses [#17987](https://github.com/ggml-org/llama.cpp/issues/17987))



Changed files:
filename: convert_hf_to_gguf.py
patch: @@ -2979,7 +2979,10 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
         return []
 
 
-@ModelBase.register("Mistral3ForConditionalGeneration")
+@ModelBase.register(
+    "Mistral3ForConditionalGeneration",
+    "Ministral3ForCausalLM",
+)
 class Mistral3Model(LlamaModel):
     model_arch = gguf.MODEL_ARCH.MISTRAL3
Repository: huggingface/transformers
Pull request: fix crash in tiiuae/falcon-11B-vlm image-to-text generation

# What does this PR do?

fix crash when using tiiuae/falcon-11B-vlm for image-to-text generation task

fix two crashes
1. one is in inputs_embeds calculation, "image_token_index": 65024 while "vocab_size": 65024, so embedding operation out of bounds
2. language_modeling forward in llava_next. the parameters contains num_logits_to_keep, while forward of FalconForCausalLM does not contain the params. crash in forward API calling 



- vision models: @amyeroberts, @qubvel



Changed files:
filename: src/transformers/models/falcon/modeling_falcon.py
patch: @@ -1277,12 +1277,18 @@ def forward(
         output_hidden_states: Optional[bool] = None,
         return_dict: Optional[bool] = None,
         cache_position: Optional[torch.LongTensor] = None,
+        num_logits_to_keep: int = 0,
     ) -> Union[Tuple[torch.Tensor], CausalLMOutputWithCrossAttentions]:
         r"""
         labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
             Labels for language modeling. Note that the labels **are shifted** inside the model, i.e. you can set
             `labels = input_ids` Indices are selected in `[-100, 0, ..., config.vocab_size]` All labels set to `-100`
             are ignored (masked), the loss is only computed for labels in `[0, ..., config.vocab_size]`
+
+        num_logits_to_keep (`int`, *optional*):
+            Calculate logits for the last `num_logits_to_keep` tokens. If `0`, calculate logits for all
+            `input_ids` (special case). Only last token logits are needed for generation, and calculating them only for that
+            token can save memory, which becomes pretty significant for long sequences or large vocabulary size.
         """
 
         return_dict = return_dict if return_dict is not None else self.config.use_return_dict
@@ -1302,7 +1308,7 @@ def forward(
         )
         hidden_states = transformer_outputs[0]
 
-        lm_logits = self.lm_head(hidden_states)
+        lm_logits = self.lm_head(hidden_states[:, -num_logits_to_keep:, :])
 
         loss = None
         if labels is not None:
Repository: vercel/next.js
Pull request: Honour `NEXT_TEST_PREFER_OFFLINE` in `install-native.mjs`

The `scripts/install-native.mjs` script is run in the postinstall step of the Next.js monorepo to install the published binary packages of the latest Next.js canary version. This change makes the script respect the `NEXT_TEST_PREFER_OFFLINE` environment variable, allowing it to prefer installing previously downloaded packages from the local cache. This is useful for scenarios where network access is limited or unavailable.

Changed files:
filename: scripts/install-native.mjs
patch: @@ -10,6 +10,9 @@ import fsp from 'fs/promises'
     )
     return
   }
+
+  const preferOffline = process.env.NEXT_TEST_PREFER_OFFLINE === '1'
+
   let cwd = process.cwd()
   const { version: nextVersion } = JSON.parse(
     fs.readFileSync(path.join(cwd, 'packages', 'next', 'package.json'))
@@ -57,9 +60,11 @@ import fsp from 'fs/promises'
     fs.writeFileSync(path.join(tmpdir, 'package.json'), JSON.stringify(pkgJson))
     fs.writeFileSync(path.join(tmpdir, '.npmrc'), 'node-linker=hoisted')
 
-    let { stdout } = await execa('pnpm', ['add', `next@${nextVersion}`], {
-      cwd: tmpdir,
-    })
+    const args = ['add', `next@${nextVersion}`]
+    if (preferOffline) {
+      args.push('--prefer-offline')
+    }
+    let { stdout } = await execa('pnpm', args, { cwd: tmpdir })
     console.log(stdout)
 
     let pkgs = fs.readdirSync(path.join(tmpdir, 'node_modules/@next'))
Repository: facebook/react
Pull request: [tests] <StrictMode /> nested in tree is broken

Adds a test that shows using <StrictMode /> anywhere outside of the root node will not fire strict effects.

This works:

```js
root.render(
  <StrictMode>
    <App>
      <Children />
    </App>
  </StrictMode>
);
  ```
  
  This does not fire strict effects on mount:
```js
root.render(
  <App>
    <StrictMode>
      <Children />
    </StrictMode>
  </App>
);
```

Changed files:
filename: packages/react/src/__tests__/ReactStrictMode-test.internal.js
patch: @@ -179,6 +179,40 @@ describe('ReactStrictMode', () => {
           'B: useEffect mount',
         ]);
       });
+
+      it('should support nested strict mode on initial mount', async () => {
+        function Wrapper({children}) {
+          return children;
+        }
+        await act(() => {
+          const container = document.createElement('div');
+          const root = ReactDOMClient.createRoot(container);
+          root.render(
+            <Wrapper>
+              <Component label="A" />
+              <React.StrictMode>
+                <Component label="B" />,
+              </React.StrictMode>
+              ,
+            </Wrapper>,
+          );
+        });
+
+        expect(log).toEqual([
+          'A: render',
+          'B: render',
+          'B: render',
+          'A: useLayoutEffect mount',
+          'B: useLayoutEffect mount',
+          'A: useEffect mount',
+          'B: useEffect mount',
+          // TODO: this is currently broken
+          // 'B: useLayoutEffect unmount',
+          // 'B: useEffect unmount',
+          // 'B: useLayoutEffect mount',
+          // 'B: useEffect mount',
+        ]);
+      });
     }
   });
 });