sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: `doctest` line number is incorrect if used with #![doc = include_str!()]
Labels: T-rustdoc,C-bug,A-doctests

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/README.md"))]

/// ```no_run << line 23
///  panic!("nooo");
///  ```
pub struct XXXXYYYY<A, B> {
...
}
```

I expected to see this happen: the included doctests show the line number of the include statement.

Instead, this happened:

```
running 2 tests
test src/lib.rs - XXXXYYYY (line 23) - compile ... ok
test src/lib.rs - (line 23) ... FAILED
```

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.81.0-nightly (032be6f7b 2024-07-16)
binary: rustc
commit-hash: 032be6f7bbe091c7dfa29f115e94b9cc9bae1758
commit-date: 2024-07-16
host: aarch64-apple-darwin
release: 1.81.0-nightly
LLVM version: 18.1.7
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary>Backtrace</summary>
<p>

```
N/A
```

</p>
</details>
Repository: terminal
Issue: SetConsoleActiveScreenBuffer breaks Unicode output
Labels: Product-Conpty,Issue-Bug,Needs-Tag-Fix,Priority-3

### Windows Terminal version

1.22.1972 and newer

### Windows build number

10.0.19045.4412

### Other Software

No

### Steps to reproduce

1. Compile this simple program:
```C++
#include <windows.h>

int main()
{
    const auto Output = GetStdHandle(STD_OUTPUT_HANDLE);
    DWORD n;
    WriteConsole(Output, L"𠜎𠝹𠱓𠱸𠲖𠳏𠳕𠴕𠵼𠵿𠸎\n", 23, &n, {});
    WriteConsole(Output, L"💖💫🐶🐇🌎🏃\n", 13, &n, {});
    MessageBox({}, L"Press OK", {}, 0);
    const auto NewBuffer = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, {}, CONSOLE_TEXTMODE_BUFFER, {});
    SetConsoleActiveScreenBuffer(NewBuffer);
    SetConsoleActiveScreenBuffer(Output);
    MessageBox({}, L"See?", {}, 0);
}
```
2. Run it.
3. Follow the instructions.

### Expected Behavior

The text stays intact after pressing OK (and calling `SetConsoleActiveScreenBuffer(Output);`):

![image](https://github.com/user-attachments/assets/474ca7a0-f487-4e5d-94b2-339d39eaa5ce)


### Actual Behavior

The text is broken, as if a bad conversion happens somewhere:

![image](https://github.com/user-attachments/assets/3a6a8e41-29a1-4f69-85a7-a2f39bef56ad)

#### Observations

- It stopped working somewhere between WT 1.22.1511.0 (1.22.240530001, 31 May) and 1.22.1972.0 (1.22.240715002, 17 Jul). Unfortunately I don't have any other versions in between.
- OpenConsole is not affected, only WT.
Repository: react
Issue: Bug: useFormStatus pending state is reset when component state is updated
Labels: Type: Bug,React 19

If you have a component that relies on the `pending` return value of `useFormStatus`, the `pending` state will incorrectly reset to `false` if the component is updated due to a `useState` update. This does not happen if the `useState` hook is placed in a child component. 

React version: 19.0.0-rc-512b09b2-20240718

## Steps To Reproduce

[codesandbox.io/p/sandbox/react-useformstatus-pending-reset-on-unrelated-state-update-m59zw8](https://codesandbox.io/p/sandbox/react-useformstatus-pending-reset-on-unrelated-state-update-m59zw8)

1. Create a react app that uses form actions (this uses NextJS starter code)
2. Have the form action delay for a set period of time before resolving
3. Create a child component that uses `useFormStatus().pending`. Have the component also use a `useState` hook that updates on an interval using `useEffect`. 
4. Place this child component as a child of the `<form />` element
5. Verify that `useFormStatus().pending` is reset to false as soon as a call to `setState` happns

Example component

```

export default function SubmissionState() {
  const formStatus = useFormStatus();
  const [counter, setCounter] = useState(0);
  useEffect(() => {
    const id = setTimeout(() => {
      if (!formStatus.pending) {
        setCounter(0);
        return;
      }
      setCounter(counter + 1);
    }, 1000);
    return () => clearTimeout(id);
  }, [counter, formStatus.pending]);
  return (
    <div>
      {formStatus.pending ? `Pending for ${counter} seconds` : "Not pending"}
    </div>
  );
}
```

this example works as expected, `useFormStatus().pending` state matches the server actions state

```
function SubmissionStateBody({ pending }: { pending: boolean }) {
  const [counter, setCounter] = useState(0);
  useEffect(() => {
    if (!pending) {
      setCounter(0);
      return;
    }
    const id = setTimeout(() => {
      setCounter(counter + 1);
    }, 1000);
    return () => clearTimeout(id);
  }, [counter, pending]);
  return (
    <div>{pending ? `Pending for ${counter} seconds` : "Not pending"}</div>
  );
}

export default function SubmissionStateCorrect() {
  const formStatus = useFormStatus();
  return <SubmissionStateBody pending={formStatus.pending} />;
}
``` 

Link to code example:

[Github repro using nextjs starter template](https://github.com/jatwood/repro-use-form-issue)

## The current behavior

The UI shows the submission as pending for the length of the server action.


## The expected behavior

The UI shows the submission as not-pending as soon as the counter is updated.
Repository: pytorch
Issue: xeon.run_cpu will not use numactl when whithin a docker container run with --cpuset-cpus non-0 numa node
Labels: module: performance,module: cpu,triaged

If we are using docker container which created by following command line, it will only use numa node 1. 
```shell
docker run --privileged --cpuset-cpus=40-79 --cpuset-mems=1 docker_image_name
```

In this case, numactl is available for `numactl -C 40 -m 1 hostname`. But `run_cpu.py` will use taskset to replace numactl. Therefore, performance might not be stable, taskset do not support memory binding.

https://github.com/pytorch/pytorch/blob/433ef4e4443af4d1921ccd6cd49fb2253481b58c/torch/backends/xeon/run_cpu.py#L307-L322

```
19:13:22  + python -m torch.backends.xeon.run_cpu --node_id 1 benchmarks/dynamo/torchbench.py --performance --amp -dcpu --output=inductor_log/multi_threads_cf_logs_20240705_111313/inductor_torchbench_amp_inference_cpu_performance.csv --inference -n50 --inductor --timeout 9000 --freezing --no-skip --dashboard -x sam -x hf_T5_generate -x nanogpt -x llava -x hf_Whisper -x llama_v2_7b_16h -x stable_diffusion_text_encoder -x tacotron2 -x simple_gpt -x hf_clip -x torchrec_dlrm -x cm3leon_generate -x sam_fast -x simple_gpt_tp_manual -x detectron2_maskrcnn -x stable_diffusion -x llama_v2_7b_16h --cold-start-latency
19:13:23  2024-07-05 11:13:17,543 - __main__ - WARNING - Core binding with numactl is not available. Disabling numactl and using taskset instead.                     This may affect performance in multi-socket system; please use numactl if memory binding is needed.
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - Use JeMalloc memory allocator
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - OMP_NUM_THREADS=32
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - Using Intel OpenMP
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - KMP_AFFINITY=granularity=fine,compact,1,0
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - KMP_BLOCKTIME=1
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - LD_PRELOAD=/opt/conda/bin/..//lib/libiomp5.so:/opt/conda/bin/..//lib/libjemalloc.so
19:13:23  2024-07-05 11:13:17,544 - __main__ - INFO - taskset -c 32-63 /opt/conda/bin/python -u benchmarks/dynamo/torchbench.py --performance --amp -dcpu --output=inductor_log/multi_threads_cf_logs_20240705_111313/inductor_torchbench_amp_inference_cpu_performance.csv --inference -n50 --inductor --timeout 9000 --freezing --no-skip --dashboard -x sam -x hf_T5_generate -x nanogpt -x llava -x hf_Whisper -x llama_v2_7b_16h -x stable_diffusion_text_encoder -x tacotron2 -x simple_gpt -x hf_clip -x torchrec_dlrm -x cm3leon_generate -x sam_fast -x simple_gpt_tp_manual -x detectron2_maskrcnn -x stable_diffusion -x llama_v2_7b_16h --cold-start-latency
```

cc @msaroufim @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10
Repository: kubernetes
Issue: kubelet may provide a warning event or log when pod mount a wrong subpath from configmap
Labels: kind/bug,sig/storage,sig/node,priority/important-longterm,triage/accepted

### What happened?

When I put a **wrong subpath** in the pod, the pod still can start without any warning.
- the subpath cannot be found in the keys of the configmap volume.


### What did you expect to happen?

- kubelet may provide a warning event or log when pod mount a wrong subpath from configmap

for instance, if the configmap does not exists,
- the pod cannot start
- and there will be a warning event like 
```
4m39s       Warning   FailedMount               pod/nginx-pod-2   MountVolume.SetUp failed for volume "config-volume" : configmap "my-config-2" not found
```

But if we use subpath mount, if the key is not exist, the pod can start.


### How can we reproduce it (as minimally and precisely as possible)?

```
[root@node ~]# cat subpath/subpath2.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: my-config
data:
  index.html: |
    <html>
    <body>
    <h1>Hello, World!</h1>
    </body>
    </html>

---

apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
  - name: nginx-container
    image: nginx:1.25.3-alpine
    volumeMounts:
    - name: config-volume
      mountPath: /usr/share/nginx/html/index2.html
      subPath: index2.html
  volumes:
  - name: config-volume
    configMap:
      name: my-config
```

This pod can start. 

### Anything else we need to know?

Workarounds
1. the application can fail if nothing mounted: the problem may be that we may have default files or behavior which may not fail
2. check before applying:
  -  for instance, we can check it in the devops pipeline 
  -  use webhook to verify


### Kubernetes version

1.30

### Cloud provider

VM

### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
NAME="Rocky Linux"
VERSION="9.2 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.2"
$ uname -a
Linux node 5.14.0-284.11.1.el9_2.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 9 17:09:15 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

</details>


### Install tools

<details>
kubeadm
</details>


### Container runtime (CRI) and version (if applicable)

<details>
 containerd --version
containerd containerd.io 1.6.33 d2d58213f83a351ca8f528a95fbd145f5654e957
</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>
cilium
</details>
Repository: stable-diffusion-webui
Issue: OSError: Can't load tokenizer for 'google/t5-v1_1-xxl'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'google/t5-v1_1-xxl' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer.
Labels: bug-report

### Checklist

- [ ] The issue exists after disabling all extensions
- [ ] The issue exists on a clean installation of webui
- [ ] The issue is caused by an extension, but I believe it is caused by a bug in the webui
- [x] The issue exists in the current version of the webui
- [ ] The issue has not been reported before recently
- [ ] The issue has been reported before but has not been fixed yet

### What happened?

env:  Version: v1.10.0-RC  on ubuntu24.04  cuda12.1  pytorch2.1.2+cu121 
when switch sd3 model ,then command console report:
OSError: Can't load tokenizer for 'google/t5-v1_1-xxl'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'google/t5-v1_1-xxl' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer.

### Steps to reproduce the problem

env:  Version: v1.10.0-RC  on ubuntu24.04  cuda12.1  pytorch2.1.2+cu121 
when switch sd3 model ,then command console report:
OSError: Can't load tokenizer for 'google/t5-v1_1-xxl'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'google/t5-v1_1-xxl' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer.

### What should have happened?

env:  Version: v1.10.0-RC  on ubuntu24.04  cuda12.1  pytorch2.1.2+cu121 
when switch sd3 model ,then command console report:
OSError: Can't load tokenizer for 'google/t5-v1_1-xxl'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'google/t5-v1_1-xxl' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer.

### What browsers do you use to access the UI ?

_No response_

### Sysinfo

Version: v1.10.0-RC  on ubuntu24.04  cuda12.1  pytorch2.1.2+cu121 

### Console logs

```Shell
OSError: Can't load tokenizer for 'google/t5-v1_1-xxl'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'google/t5-v1_1-xxl' is the correct path to a directory containing all relevant files for a T5TokenizerFast tokenizer.
```


### Additional information

_No response_
Repository: go
Issue: cmd/link/internal/ld: TestArchiveBuildInvokeWithExec failures
Labels: NeedsInvestigation,compiler/runtime

```
#!watchflakes
default <- pkg == "cmd/link/internal/ld" && test == "TestArchiveBuildInvokeWithExec"
```

Issue created automatically to collect these failures.

Example ([log](https://ci.chromium.org/b/8742154403530812161)):

    === RUN   TestArchiveBuildInvokeWithExec
    === PAUSE TestArchiveBuildInvokeWithExec
    === CONT  TestArchiveBuildInvokeWithExec
        ld_test.go:120: build failure: exit status 1
            # command-line-arguments
            build mode: c-archive, symbol table: on, DWARF: on
            HEADER = -H1 -T0x100001000 -R0x4000
            loadinternal: cannot find runtime/cgo
            53585 symbols, 20057 reachable
            	24336 package symbols, 18150 hashed symbols, 8168 non-package symbols, 2931 external symbols
            88941 liveness data
            archive: /Volumes/Work/s/w/ir/cache/tools/15c500b/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar -q -c -s $WORK/b001/exe/a.out.a /Volumes/Work/s/w/ir/x/t/TestArchiveBuildInvokeWithExec4094396980/001/go.o
            invoking archiver with syscall.Exec()
            
    --- FAIL: TestArchiveBuildInvokeWithExec (0.29s)


— [watchflakes](https://go.dev/wiki/Watchflakes)
Repository: go
Issue: cmd/go: TestScript/mod_get_hash failures
Labels: NeedsInvestigation

```
#!watchflakes
default <- pkg == "cmd/go" && test == "TestScript/mod_get_hash"
```

Issue created automatically to collect these failures.

Example ([log](https://ci.chromium.org/b/8742154404318999761)):

    === RUN   TestScript/mod_get_hash
    === PAUSE TestScript/mod_get_hash
    === CONT  TestScript/mod_get_hash
        script_test.go:135: 2024-07-17T15:20:43Z
        script_test.go:137: $WORK=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-2066926295/tmpdir2198761154/mod_get_hash3183523533
        script_test.go:159: 
            PATH=/home/swarming/.swarming/w/ir/x/t/cmd-go-test-2066926295/tmpdir2198761154/testbin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/x/w/goroot/bin:/home/swarming/.swarming/w/ir/cache/tools/bin:/home/swarming/.swarming/w/ir/bbagent_utility_packages:/home/swarming/.swarming/w/ir/bbagent_utility_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages:/home/swarming/.swarming/w/ir/cipd_bin_packages/bin:/home/swarming/.swarming/w/ir/cipd_bin_packages/cpython3:/home/swarming/.swarming/w/ir/cipd_bin_packages/cpython3/bin:/home/swarming/.swarming/w/ir/cache/cipd_client:/home/swarming/.swarming/w/ir/cache/cipd_client/bin:/home/swarming/.swarming/cipd_cache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
            HOME=/no-home
            CCACHE_DISABLE=1
            GOARCH=amd64
    ...
            [stdout]
            golang.org/x/time v0.0.0-20170424234030-8be79e1e0910
            # fetch other commit hash, even with a non-standard ref, is not OK (0.166s)
            > ! go list -m golang.org/x/time@334d83c35137ac2b376c1dc3e4c7733791855a3a # refs/changes/24/41624/3
            [stderr]
            go: golang.org/x/time@334d83c35137ac2b376c1dc3e4c7733791855a3a: unrecognized import path "golang.org/x/time": reading https://golang.org/x/time?go-get=1: 500 Internal Server Error
            [exit status 1]
            > stderr 'unknown revision'
        script_test.go:159: FAIL: testdata/script/mod_get_hash.txt:12: stderr 'unknown revision': no match for `(?m)unknown revision` in stderr
    --- FAIL: TestScript/mod_get_hash (10.92s)


— [watchflakes](https://go.dev/wiki/Watchflakes)
Repository: stable-diffusion-webui
Issue: 如何增加关键词的审核判断呢，例如对接百度的内容审核
Labels: enhancement

### Is there an existing issue for this?

- [X] I have searched the existing issues and checked the recent builds/commits

### What would your feature do ?

用于过滤一些敏感词

### Proposed workflow

用于过滤一些敏感词

### Additional information

_No response_
Repository: kubernetes
Issue: Taint Tolerance Tied to Pod Disruption Budget Availability
Labels: kind/feature,sig/apps,needs-triage

### What would you like to be added?

Add a new field to tolerations API to ensure that the PDBs are honored while deleting pods during Taint Based Evictions

### Why is this needed?

The current approach of using tolerationSeconds in pod specifications has two key limitations:

 - Most application developers and cluster operators lack the detailed knowledge required to set tolerationSeconds accurately, leading to guesswork and potential issues. Some clusters have had to implement validating webhooks to prevent indefinite tolerations.
- Taint-based "evictions" ultimately result in [pod deletion](https://github.com/kubernetes/kubernetes/blob/1b3d7d06c59c44de2775975a599130a2f89539fb/pkg/controller/tainteviction/taint_eviction.go#L146), but some workloads require stronger disruption handling guarantees. Cluster admins and developers have had to write custom webhooks to intercept these deletion requests.

To address these challenges, we propose introducing a new field in the Tolerations API called runAsLongAsPDB (or a similar name). This new field would allow users to express their intent to run the workload as long as the Pod Disruption Budget (PDB) exists, eliminating the need for guesswork around tolerationSeconds and providing better disruption handling guarantees. This new functionality would be designed to be backward-compatible with the existing tolerationSeconds approach, allowing both new and existing workloads to benefit from the improved disruption management capabilities
Repository: svelte
Issue: Svelte 5 REPL renders wrong active tab/file when `App.svelte` is not the first tab
Labels: site

### Describe the bug

I came across this REPL https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE51RQU7DMBD8ymIhtRVRAtc0rYT6BI6EA7gb5BLvWraDQJb_jt20SQ8IBCfHk9nZmXEQnerRifoxCHrWKGrx4Nli6d6x9ygK4T9NRg8ufTserMw3_DBsPfTogQYNG7hdt9TSCe4Gkl4xgSJpUSP55QpCIvhMvtnAXWLHpKd5rzqFe1F7O2AsJg_3xsyrJyvT-sZJq4zfZkmljztDNlLMGyFCZ1nDoqwuA5UHt1hfjO04nZT5Z_aEnCaO9DQwheqYz3GSzJxwPSKSyXGPZc-vy2RphGNLTTWbpmbeG5JehGr7Ux0T-z-l_NZEfsSQUyXiBq6NZePGNJepmWSv5Nuc_FjDnzK_DN4npXCSittdPkDjFdSrphp_f9PDU_wCkWj2IKYCAAA=

When you open it, `App.svelte` is the active tab. But it shows contents of `Store.svelte.js`. If you edit the contents, it will overwrite `Store.svelte.js` with what is currently in `App.svelte`

### Reproduction

https://svelte-5-preview.vercel.app/#H4sIAAAAAAAAE51RQU7DMBD8ymIhtRVRAtc0rYT6BI6EA7gb5BLvWraDQJb_jt20SQ8IBCfHk9nZmXEQnerRifoxCHrWKGrx4Nli6d6x9ygK4T9NRg8ufTserMw3_DBsPfTogQYNG7hdt9TSCe4Gkl4xgSJpUSP55QpCIvhMvtnAXWLHpKd5rzqFe1F7O2AsJg_3xsyrJyvT-sZJq4zfZkmljztDNlLMGyFCZ1nDoqwuA5UHt1hfjO04nZT5Z_aEnCaO9DQwheqYz3GSzJxwPSKSyXGPZc-vy2RphGNLTTWbpmbeG5JehGr7Ux0T-z-l_NZEfsSQUyXiBq6NZePGNJepmWSv5Nuc_FjDnzK_DN4npXCSittdPkDjFdSrphp_f9PDU_wCkWj2IKYCAAA=

[Screencast from 2024-07-18 08-16-58.webm](https://github.com/user-attachments/assets/b37ccf5b-8bfd-45b9-9e9c-a18e242f791c)


### Logs

_No response_

### System Info

```shell
REPL
```


### Severity

annoyance
Repository: transformers
Issue: static cache implementation is not compatible with attn_implementation==flash_attention_2
Labels: Feature request,bug,Cache

### System Info

- `transformers` version: 4.43.0.dev0
- Platform: Linux-4.18.0-425.3.1.el8.x86_64-x86_64-with-glibc2.35
- Python version: 3.10.12
- Huggingface_hub version: 0.23.5
- Safetensors version: 0.4.3
- Accelerate version: 0.33.0.dev0
- Accelerate config:    not found
- PyTorch version (GPU?): 2.3.0+cu121 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?: <fill in>
- Using GPU in script?: <fill in>
- GPU type: NVIDIA A100 80GB PCIe

### Who can help?

@ArthurZucker 

### Information

- [x] The official example scripts
- [ ] My own modified scripts

### Tasks

- [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

```bash
pytest -rA tests/test_cache_utils.py::CacheIntegrationTest -k "test_static_cache_greedy_decoding_pad_left and flash_attention"
```
fails with 
```bash
    def forward(
        self,
        hidden_states: torch.Tensor,
        attention_mask: Optional[torch.LongTensor] = None,
        position_ids: Optional[torch.LongTensor] = None,
        past_key_value: Optional[Cache] = None,
        output_attentions: bool = False,
        use_cache: bool = False,
        cache_position: Optional[torch.LongTensor] = None,
    ) -> Tuple[torch.Tensor, Optional[torch.Tensor], Optional[Tuple[torch.Tensor]]]:
        if isinstance(past_key_value, StaticCache):
>           raise ValueError(
                "`static` cache implementation is not compatible with `attn_implementation==flash_attention_2` "
                "make sure to use `sdpa` in the mean time, and open an issue at https://github.com/huggingface/transformers"
            )
E           ValueError: `static` cache implementation is not compatible with `attn_implementation==flash_attention_2` make sure to use `sdpa` in the mean time, and open an issue at https://github.com/huggingface/transformers

src/transformers/models/llama/modeling_llama.py:388: ValueError
```

And the right padding test case also fails:
```bash
pytest -rA tests/test_cache_utils.py::CacheIntegrationTest -k "test_static_cache_greedy_decoding_pad_right and flash_attention"
```



### Expected behavior

Either we don't test `flash_attention` in this case, or we should add a if check to skip setting `cache_implementation` to `static`.