helloadhavan/github_issues huggingface dataset:
Repository: huggingface/transformers
Pull request: Decouple device_map='auto' and tp_plan='auto' 

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/38771. 
This PR decouples device_map='auto' and tp_plan='auto'. Before, launching a distributed run when the `device_map` was set to "auto" triggered TP. We removed that and the user should instead pass tp_plan="auto" or tp_size to tigger TP. 
Also, we warn/info that this might lead to an unexpected behavior with someone tries to run a distributed run with device_map = "auto". 

Changed files:
filename: src/transformers/modeling_utils.py
patch: @@ -4431,10 +4431,12 @@ def from_pretrained(
                 "`tp_plan` and `device_map` are mutually exclusive. Choose either one for parallelization."
             )
 
-        # If torchrun was used, make sure to TP by default. This way people don't need to change tp or device map
-        if device_map == "auto" and tp_plan is None and int(os.environ.get("WORLD_SIZE", 0)):
-            tp_plan = "auto"  # device_map = "auto" in torchrun equivalent to TP plan = AUTO!
-            device_map = None
+        if device_map == "auto" and int(os.environ.get("WORLD_SIZE", 0)):
+            logger.info(
+                "You've set device_map=`auto` while triggering a distributed run with torchrun. This might lead to unexpected behavior. "
+                "If your plan is to load the model on each device, you should set device_map={"
+                ": PartialState().process_index} where PartialState comes from accelerate library"
+            )
 
         # We need to correctly dispatch the model on the current process device. The easiest way for this is to use a simple
         # `device_map` pointing to the correct device
Repository: ggml-org/llama.cpp
Pull request: ggml : set_rows type coverage

Tracking supported types for the `ggml_set_rows` operator. When coverage is completed, we will enable this functionality (i.e. `LLAMA_SET_ROWS`) by default.

- [x] Metal
- [x] Vulkan 
- [x] CUDA
- [ ] OpenCL
  - [x] FP32
  - [x] F16 
  - [ ] BF16
  - [ ] Q8_0
  - [ ] Q5_1
  - [ ] Q5_0
  - [ ] Q4_1
  - [ ] Q4_0
  - [ ] IQ4_NL
- [x] SYCL
- [ ] CANN
  - [x] F32
  - [x] F16
  - [ ] BF16
  - [ ] Q8_0
  - [ ] Q5_1
  - [ ] Q5_0
  - [ ] Q4_1
  - [ ] Q4_0
  - [ ] IQ4_NL
- [x] WebGPU
  - [x] F16

Changed files:
filename: ggml/src/ggml-cann/ggml-cann.cpp
patch: @@ -2090,6 +2090,7 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev,
             {
                 // TODO: add support
                 // ref: https://github.com/ggml-org/llama.cpp/pull/14274
+#pragma message("TODO: implement F32, F16, BF16, Q4_0, Q4_1, Q5_0, Q5_1, Q8_0, IQ4_NL support (https://github.com/ggml-org/llama.cpp/pull/14661)")
                 return false;
             } break;
         case GGML_OP_CPY: {

filename: ggml/src/ggml-cuda/ggml-cuda.cu
patch: @@ -3222,6 +3222,7 @@ 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) &&
                        op->src[0]->type == GGML_TYPE_F32 &&
                        op->src[1]->type == GGML_TYPE_I64;

filename: ggml/src/ggml-opencl/ggml-opencl.cpp
patch: @@ -2280,6 +2280,7 @@ static bool ggml_opencl_supports_op(ggml_backend_dev_t dev, const struct ggml_te
             {
                 // TODO: add support
                 // ref: https://github.com/ggml-org/llama.cpp/pull/14274
+#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)")
                 if (op->src[0]->type != GGML_TYPE_F32) {
                     return false;
                 }

filename: ggml/src/ggml-sycl/ggml-sycl.cpp
patch: @@ -4303,6 +4303,7 @@ static bool ggml_backend_sycl_device_supports_op(ggml_backend_dev_t dev, const g
             {
                 // TODO: add support
                 // ref: https://github.com/ggml-org/llama.cpp/pull/14274
+#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 && op->src[0]->type == GGML_TYPE_F32 && op->src[1]->type == GGML_TYPE_I64));
             } break;
         case GGML_OP_CPY:
Repository: facebook/react
Pull request: Remove temporary CircleCI workaround

There was a CircleCI bug that prevented the sizebot job from accessing the artifacts API. I had added a temporary workaround to pull from a mirror instead. This seems to have been fixed, so I can remove the workaround.

Changed files:
filename: .circleci/config.yml
patch: @@ -151,32 +151,11 @@ jobs:
       - setup_node_modules
       - run:
           name: Download artifacts for base revision
-          # TODO: The download-experimental-build.js script works by fetching
-          # artifacts from CI. CircleCI recently updated this endpoint to
-          # require an auth token. This is a problem for PR branches, where
-          # sizebot needs to run, because we don't want to leak the token to
-          # arbitrary code written by an outside contributor.
-          #
-          # This only affects PR branches. CI workflows that run on the main
-          # branch are allowed to access environment variables, because only those
-          # with push access can land code in main.
-          #
-          # As a temporary workaround, we'll fetch the assets from a mirror.
-          # Need to figure out a longer term solution for this.
-          #
-          # Original code
-          #
-          # command: |
-          #     git fetch origin main
-          #     cd ./scripts/release && yarn && cd ../../
-          #     scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main) --allowBrokenCI
-          #     mv ./build ./base-build
-          #
-          # Workaround. Fetch the artifacts from react-builds.vercel.app. This
-          # is the same app that hosts the sizebot diff previews.
           command: |
-            curl -L --retry 60 --retry-delay 10 --retry-max-time 600 https://react-builds.vercel.app/api/commits/$(git merge-base HEAD origin/main)/artifacts/build.tgz | tar -xz
-              mv ./build ./base-build
+            git fetch origin main
+            cd ./scripts/release && yarn && cd ../../
+            scripts/release/download-experimental-build.js --commit=$(git merge-base HEAD origin/main) --allowBrokenCI
+            mv ./build ./base-build
 
       - run:
           # TODO: The `download-experimental-build` script copies the npm
Repository: denoland/deno
Pull request: fix(lsp): preserve notification order after init flag is raised

This fixes desyncs/errors/panics that can happen in the LSP if the user makes edits while `initialized` is still being handled, due to the unblocked notifications from `LanguageServer::init_flag: AsyncFlag` being resumed in the wrong order. Hard to test.

Changing the flag implementation from `CancellationToken::cancel()` to `Semaphore::close()` seems to do the job.

Changed files:
filename: cli/util/sync/async_flag.rs
patch: @@ -1,20 +1,28 @@
 // Copyright 2018-2025 the Deno authors. MIT license.
 
-use tokio_util::sync::CancellationToken;
+use std::sync::Arc;
 
-#[derive(Debug, Default, Clone)]
-pub struct AsyncFlag(CancellationToken);
+use tokio::sync::Semaphore;
+
+#[derive(Debug, Clone)]
+pub struct AsyncFlag(Arc<Semaphore>);
+
+impl Default for AsyncFlag {
+  fn default() -> Self {
+    Self(Arc::new(Semaphore::new(0)))
+  }
+}
 
 impl AsyncFlag {
   pub fn raise(&self) {
-    self.0.cancel();
+    self.0.close();
   }
 
   pub fn is_raised(&self) -> bool {
-    self.0.is_cancelled()
+    self.0.is_closed()
   }
 
-  pub fn wait_raised(&self) -> impl std::future::Future<Output = ()> + '_ {
-    self.0.cancelled()
+  pub async fn wait_raised(&self) {
+    self.0.acquire().await.unwrap_err();
   }
 }
Repository: electron/electron
Pull request: build: add `NSPrefersDisplaySafeAreaCompatibilityMode` = `false` to Info.plist

#### Description of Change
https://support.apple.com/en-us/102125
> Apps can be updated to work better with this area of your screen. If a developer updates their app for compatibility with your Mac, the "Scale to fit below built-in camera" setting no longer appears.

https://developer.apple.com/documentation/bundleresources/information-property-list/nsprefersdisplaysafeareacompatibilitymode

#### Checklist
- [x] PR description included and stakeholders cc'd
- [x] `npm test` passes
- [ ] tests are [changed or added](https://github.com/electron/electron/blob/main/docs/development/testing.md)
- [ ] relevant documentation, tutorials, templates and examples are changed or added
- [x] [PR release notes](https://github.com/electron/clerk/blob/main/README.md) describe the change in a way relevant to app developers, and are [capitalized, punctuated, and past tense](https://github.com/electron/clerk/blob/main/README.md#examples).

#### Release Notes
Notes: Added `NSPrefersDisplaySafeAreaCompatibilityMode` = `false` to Info.plist to remove "Scale to fit below built-in camera." from app options.

Changed files:
filename: shell/browser/resources/mac/Info.plist
patch: @@ -64,5 +64,7 @@
         <string>${DEFAULT_APP_ASAR_HEADER_SHA}</string>
       </dict>
     </dict>
+    <key>NSPrefersDisplaySafeAreaCompatibilityMode</key>
+    <false/>
   </dict>
 </plist>
Repository: nodejs/node
Pull request: build: use clang-cl in coverage-windows workflow

And do not lose time trying to regenerate the project and rebuild
before running the tests.


Changed files:
filename: .github/workflows/coverage-windows.yml
patch: @@ -57,11 +57,11 @@ jobs:
       - name: Environment Information
         run: npx envinfo
       - name: Build
-        run: ./vcbuild.bat
+        run: ./vcbuild.bat clang-cl
       # TODO(bcoe): investigate tests that fail with coverage enabled
       # on Windows.
       - name: Test
-        run: ./vcbuild.bat test-ci-js; node -e 'process.exit(0)'
+        run: ./vcbuild.bat noprojgen nobuild test-ci-js; node -e 'process.exit(0)'
         env:
           NODE_V8_COVERAGE: ./coverage/tmp
       - name: Report
Repository: ggml-org/llama.cpp
Pull request: ci : continue file download with wget

For some reason the `-N` flag alone is not enough to prevent re-downloading the file on MacOS. Adding `-c` seems to resolve the issue.

Changed files:
filename: ci/run.sh
patch: @@ -106,7 +106,7 @@ function gg_wget {
     cd $out
 
     # should not re-download if file is the same
-    wget -nv -N $url
+    wget -nv -c -N $url
 
     cd $cwd
 }
Repository: vercel/next.js
Pull request: Turbopack: guard against more eventual consistency

These might be `None` due to eventual consistency. Don't crash the build because of that.

Closes PACK-4951

Changed files:
filename: turbopack/crates/turbopack-ecmascript/src/lib.rs
patch: @@ -1302,8 +1302,16 @@ async fn merge_modules(
 
     let export_contexts = contents
         .iter()
-        .map(|(module, content)| (*module, content.export_contexts.as_ref().unwrap()))
-        .collect::<FxHashMap<_, _>>();
+        .map(|(module, content)| {
+            Ok((
+                *module,
+                content
+                    .export_contexts
+                    .as_ref()
+                    .context("expected exports contexts")?,
+            ))
+        })
+        .collect::<Result<FxHashMap<_, _>>>()?;
 
     let (merged_ast, inserted) = GLOBALS.set(globals_merged, || {
         // As an optimization, assume an average number of 5 contexts per module.
@@ -1325,7 +1333,9 @@ async fn merge_modules(
                                 .next_power_of_two()
                                 .trailing_zeros(),
                             current_module: *module,
-                            current_module_idx: module_contexts.get_index_of(module).unwrap()
+                            current_module_idx: module_contexts
+                                .get_index_of(module)
+                                .context("expected module in module_contexts")?
                                 as u32,
                             reverse_module_contexts: module_contexts
                                 .iter()
@@ -1334,7 +1344,8 @@ async fn merge_modules(
                             export_contexts: &export_contexts,
                             unique_contexts_cache: &mut unique_contexts_cache,
                         });
-                    });
+                        anyhow::Ok(())
+                    })?;
 
                     Ok(match program.take() {
                         Program::Module(module) => Either::Left(module.body.into_iter()),
Repository: ggml-org/llama.cpp
Pull request: chat: handle gpt-oss return/end token inconsistency

This commit addresses an inconsistency during inference by adding a new member to the `templates_params` struct to indicate whether the chat is in inference mode. This allows the gpt-oss specific function `common_chat_params_init_gpt_oss` to check this flag and the `add_generation_prompt` flag to determine if it should replace the `
` token with the `
` token in the prompt.

The motivation for this change is to ensure that the formatted prompt of past messages in `common_chat_format_single` matches the output of the formatted new message. The issue is that the gpt-oss template returns different end tags: `
` when `add_generation_prompt` is false, and `
` when `add_generation_prompt` is true. This causes the substring function to start at an incorrect position, resulting in tokenization starting with 'tart|>' instead of '
'.

Resolves: https://github.com/ggml-org/llama.cpp/issues/15417


Changed files:
filename: common/chat.cpp
patch: @@ -147,6 +147,7 @@ struct templates_params {
     json extra_context;
     bool add_bos;
     bool add_eos;
+    bool is_inference = true;
 };
 
 common_chat_tool_choice common_chat_tool_choice_parse_oaicompat(const std::string & tool_choice) {
@@ -1336,6 +1337,17 @@ static common_chat_params common_chat_params_init_gpt_oss(const common_chat_temp
     common_chat_params data;
     auto prompt = apply(tmpl, inputs);
 
+    // Check if we need to replace the return token with end token during
+    // inference and without generation prompt. For more details see:
+    // https://github.com/ggml-org/llama.cpp/issues/15417
+    if (inputs.is_inference && !inputs.add_generation_prompt) {
+        static constexpr std::string_view return_token = "
";
+        static constexpr std::string_view end_token    = "
";
+        if (size_t pos = prompt.rfind(return_token); pos != std::string::npos) {
+            prompt.replace(pos, return_token.length(), end_token);
+        }
+    }
+
     data.prompt = prompt;
     data.format = COMMON_CHAT_FORMAT_GPT_OSS;
Repository: facebook/react
Pull request: fix[devtools/useTransition]: don't check for dispatch property when determining if hook is stateful

https://github.com/facebook/react/pull/26740 introduced regression: React DevTools doesn't record updates for `useTransition` hook. I can add more details about things on DevTools side, if needed.

The root cause is https://github.com/facebook/react/blob/491aec5d6113ce5bae7c10966bc38a4a8fc091a8/packages/react-reconciler/src/ReactFiberHooks.js#L2728-L2730

React DevTools expects dispatch to be present for stateful hooks that can schedule an update - https://github.com/facebook/react/blob/2eed1328478e8c923fcb4e6abf5efbd9e1233402/packages/react-devtools-shared/src/backend/renderer.js#L1422-L1428

With these changes, we still call dispatch in `startTransition`, but also patch `queue` object with it, so that React DevTools can recognise `useTransition` as stateful hook that can schedule update.

I am not sure if this is the right approach to fix this, can we distinguish if `startTransition` was called from `useTransition` hook or as a standalone function?

Changed files:
filename: packages/react-devtools-shared/src/backend/renderer.js
patch: @@ -1419,22 +1419,20 @@ export function attach(
 
     const boundHasOwnProperty = hasOwnProperty.bind(queue);
 
-    // Detect the shape of useState() or useReducer()
+    // Detect the shape of useState() / useReducer() / useTransition()
     // using the attributes that are unique to these hooks
     // but also stable (e.g. not tied to current Lanes implementation)
-    const isStateOrReducer =
-      boundHasOwnProperty('pending') &&
-      boundHasOwnProperty('dispatch') &&
-      typeof queue.dispatch === 'function';
+    // We don't check for dispatch property, because useTransition doesn't have it
+    if (boundHasOwnProperty('pending')) {
+      return true;
+    }
 
     // Detect useSyncExternalStore()
-    const isSyncExternalStore =
+    return (
       boundHasOwnProperty('value') &&
       boundHasOwnProperty('getSnapshot') &&
-      typeof queue.getSnapshot === 'function';
-
-    // These are the only types of hooks that can schedule an update.
-    return isStateOrReducer || isSyncExternalStore;
+      typeof queue.getSnapshot === 'function'
+    );
   }
 
   function didStatefulHookChange(prev: any, next: any): boolean {
Repository: electron/electron
Pull request: build: add `NSPrefersDisplaySafeAreaCompatibilityMode` = `false` to Info.plist

Backport of #45318

See that PR for details.


Notes: Added `NSPrefersDisplaySafeAreaCompatibilityMode` = `false` to Info.plist to remove "Scale to fit below built-in camera." from app options.

Changed files:
filename: shell/browser/resources/mac/Info.plist
patch: @@ -64,5 +64,7 @@
         <string>${DEFAULT_APP_ASAR_HEADER_SHA}</string>
       </dict>
     </dict>
+    <key>NSPrefersDisplaySafeAreaCompatibilityMode</key>
+    <false/>
   </dict>
 </plist>
Repository: huggingface/transformers
Pull request: [glm4v] fix video inference

# What does this PR do?

I broke video inference in a recent PR by copying from Qwen2-VL. Comes out GLM4V doesn't have a video token and instead uses image token id repeated many times per frame

No need for patching, only the main branch is broken

Changed files:
filename: src/transformers/models/glm4v/modeling_glm4v.py
patch: @@ -1269,13 +1269,13 @@ def forward(
 
             if input_ids is None:
                 video_mask = inputs_embeds == self.get_input_embeddings()(
-                    torch.tensor(self.config.video_token_id, dtype=torch.long, device=inputs_embeds.device)
+                    torch.tensor(self.config.image_token_id, dtype=torch.long, device=inputs_embeds.device)
                 )
                 video_mask = video_mask.all(-1)
             else:
-                video_mask = input_ids == self.config.video_token_id
+                video_mask = input_ids == self.config.image_token_id
 
-            n_video_tokens = (video_mask).sum()
+            n_video_tokens = video_mask.sum()
             n_video_features = video_embeds.shape[0]
             video_mask = video_mask.unsqueeze(-1).expand_as(inputs_embeds).to(inputs_embeds.device)
             if not is_torchdynamo_compiling() and n_video_tokens != n_video_features:

filename: src/transformers/models/glm4v/modular_glm4v.py
patch: @@ -1269,13 +1269,13 @@ def forward(
 
             if input_ids is None:
                 video_mask = inputs_embeds == self.get_input_embeddings()(
-                    torch.tensor(self.config.video_token_id, dtype=torch.long, device=inputs_embeds.device)
+                    torch.tensor(self.config.image_token_id, dtype=torch.long, device=inputs_embeds.device)
                 )
                 video_mask = video_mask.all(-1)
             else:
-                video_mask = input_ids == self.config.video_token_id
+                video_mask = input_ids == self.config.image_token_id
 
-            n_video_tokens = (video_mask).sum()
+            n_video_tokens = video_mask.sum()
             n_video_features = video_embeds.shape[0]
             video_mask = video_mask.unsqueeze(-1).expand_as(inputs_embeds).to(inputs_embeds.device)
             if not is_torchdynamo_compiling() and n_video_tokens != n_video_features:
Repository: facebook/react
Pull request: Test fix: Add missing warning assertion

Adds a missing test assertion for Server Context deprecation.

The PR that added this warning was based on an older revision than the PR that added the test.

Changed files:
filename: packages/react-server-dom-turbopack/src/__tests__/ReactFlightDOMBrowser-test.js
patch: @@ -612,8 +612,22 @@ describe('ReactFlightDOMBrowser', () => {
   });
 
   it('basic use(context)', async () => {
-    const ContextA = React.createServerContext('ContextA', '');
-    const ContextB = React.createServerContext('ContextB', 'B');
+    let ContextA;
+    let ContextB;
+    expect(() => {
+      ContextA = React.createServerContext('ContextA', '');
+      ContextB = React.createServerContext('ContextB', 'B');
+    }).toErrorDev(
+      [
+        'Server Context is deprecated and will soon be removed. ' +
+          'It was never documented and we have found it not to be useful ' +
+          'enough to warrant the downside it imposes on all apps.',
+        'Server Context is deprecated and will soon be removed. ' +
+          'It was never documented and we have found it not to be useful ' +
+          'enough to warrant the downside it imposes on all apps.',
+      ],
+      {withoutStack: true},
+    );
 
     function ServerComponent() {
       return use(ContextA) + use(ContextB);
Repository: vercel/next.js
Pull request: [node-webstreams] Remove unused App externals from next-server bundler config

These externals have no effect since we don't import the legacy `react-dom/server` APIs in `next-server` anyway.

We only import the modern APIs since we alias `react-dom/server` to `build/webpack/alias/react-dom-server-edge.js` which does not import from the legacy entrypoint.

## Test plan

- [x] `compiled/next-server` remained unchanged

Changed files:
filename: packages/next/next-runtime.webpack-config.js
patch: @@ -29,14 +29,7 @@ const pagesExternals = [
   'react-server-dom-webpack/static.edge',
 ]
 
-const appExternals = [
-  // Externalize the react-dom/server legacy implementation outside of the runtime.
-  // If users are using them and imported from 'react-dom/server' they will get the external asset bundled.
-  'next/dist/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js',
-  'next/dist/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js',
-  'next/dist/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js',
-  'next/dist/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js',
-]
+const appExternals = []
 
 function makeAppAliases({ experimental, bundler }) {
   const reactChannel = experimental ? '-experimental' : ''
Repository: ggml-org/llama.cpp
Pull request: ci : Fix -Werror=return-type in clip.cpp so ci/run.sh can run without issue

The CONTRIBUTING.md file suggests to run ci/run.sh before making any changes. But since that script sets `-DLLAMA_FATAL_WARNINGS` a warning from `tools/mtmd/clip.cpp`  causes the script to terminate early.  This fixes that error so that script can run



Changed files:
filename: tools/mtmd/clip.cpp
patch: @@ -3581,10 +3581,10 @@ bool clip_image_preprocess(struct clip_ctx * ctx, const clip_image_u8 * img, str
         }
 
         return true;
-
+    } else {
+        GGML_ABORT("Unknown image preprocessing type");
     }
 
-    GGML_ASSERT(false && "Unknown image preprocessing type");
 }
 
 ggml_tensor * clip_get_newline_tensor(const struct clip_ctx * ctx) {