Fixed paged|FA2 kernel loading logic and UT.
Author: YangKai0616
Pull request: yes

# What does this PR do?

**1. [General]** When running the test case `tests/generation/test_continuous_batching.py::ContinuousBatchingTest::test_continuous_batching_parity_qwen_flash`, it reports error as follows: 
```
                flash_attn_func = getattr(kernel, "flash_attn_func", None)
                flash_attn_varlen_func = getattr(kernel, "flash_attn_varlen_func", None)
                if flash_attn_varlen_func is None:
>                   raise ValueError(
                        f"Could not find the currently requested flash attention implementation at `{implementation}`."
                        "Make sure that you request a valid kernel from the hub, e.g. `kernels-community/flash-attn2`."
                    )
E                   ValueError: Could not find the currently requested flash attention implementation at `flash_attention_2`.Make sure that you request a valid kernel from the hub, e.g. `kernels-community/flash-attn2`.

src/transformers/modeling_flash_attention_utils.py:115: ValueError
```
The root cause is a kernel loading failure of `paged|flash_attention_2`. This PR fixes the issue.

**2. [XPU]** The above test case reports error `E   AssertionError: Test request_id = 'req_1' failed, no expected output was provided.....` after successfully running on both XPU and CUDA. However, on the XPU side, the test case can stably pass by using `require_deterministic_for_xpu`.

For enabling the related tests on XPU, please refer to PR https://github.com/huggingface/transformers/pull/42536.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- text models: @ArthurZucker @Cyrilvallez
- vision models: @yonigozlan @molbap
- audio models: @eustlb @ebezzam @vasqu
- multimodal models: @zucchini-nlp
- graph models: @clefourrier

Library:

- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- continuous batching: @remi-or @ArthurZucker @McPatate
- pipelines: @Rocketknight1
- tokenizers: @ArthurZucker and @itazap
- trainer: @SunMarc
- attention: @vasqu @ArthurZucker @CyrilVallez
- model loading (from pretrained, etc): @CyrilVallez
- distributed: @3outeille @ArthurZucker
- CIs: @ydshieh

Integrations:

- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization: @SunMarc @MekkCyber
- kernels: @MekkCyber @drbh
- peft: @BenjaminBossan @githubnemo

Devices/Backends:

- AMD ROCm: @ivarflakstad
- Intel XPU: @IlyasMoutawwakil
- Ascend NPU: @ivarflakstad 

Documentation: @stevhliu

Research projects are not maintained and should be taken as is.

 -->


Comments:
@vasqu , please help review, thanks!

Strange, the CI failing example `tests/models/mvp/test_modeling_mvp.py::MvpHeadTests::test_generate_beam_search` can pass on both CUDA (A100) and XPU for me (with torch 2.9).

Yup, not sure what's going on. It's an annoying flaky test. Added a new commit to simplify something, let's see if CI passes this time otherwise I'll try to get a core maintainer to merge if necessary.

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=42547&sha=f52818

Hey @vasqu , when I run the command `pytest -rA tests/test_tokenization_mistral_common.py::TestMistralCommonBackend::test_all_special_ids tests/test_tokenization_mistral_common.py::TestMistralCommonBackend::test_all_special_tokens tests/test_tokenization_mistral_common.py::TestMistralCommonBackend::test_apply_chat_template_basic` on A100 and XPU, I can’t reproduce the CI error. Could you able to reproduce it?

merge as requested by @vasqu 

(irrelevant failures)