Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 534

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/plugins/system/t4/src/t4/MVC/Router/T4.php on line 388
Intel IPEX的策略是优化现有优化器,而不是提供新的优化器类 - Bluetooth forum - bluetooth蓝牙技术

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbjdownloads/cbjdownloads.php on line 49

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbblogs/cbblogs.php on line 48

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/components/com_comprofiler/plugin/user/plug_cbarticles/cbarticles.php on line 47

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 217

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 219

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 227

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 231

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 234

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Intel IPEX的策略是优化现有优化器,而不是提供新的优化器类


Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    service
  • [
    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    service]

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    Topic Author

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    Offline
  • Administrator
  • Administrator
More
31 Jan 2026 08:11 #1116
Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
by service
New Topic
=== Intel IPEX 优化器路径诊断 ===
操作系统: win32
Python 版本: 3.11.14 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 18:30:03) [MSC v.1929 64 bit (AMD64)]
Torch 版本: 2.6.0+xpu
Intel IPEX 版本: 2.6.10+xpu

=== 检查 IPEX 模块结构 ===
1. ipex 主要模块:
   - FP32MathMode: <class 'enum.EnumType'>
   - WarningType: <class 'enum.EnumType'>
   - base_py_dll_path: <class 'str'>
   - builtins: <class 'module'>
   - cmake_prefix_path: <class 'str'>
   - compatible_mode: <class 'function'>
   - cpu: <class 'module'>
   - ctypes: <class 'module'>
   - disable_auto_channels_last: <class 'function'>
   - distributed: <class 'module'>
   - dll: <class 'str'>
   - dll_path: <class 'str'>
   - dll_paths: <class 'list'>
   - dlls: <class 'list'>
   - enable_auto_channels_last: <class 'function'>
   - frontend: <class 'module'>
   - fx: <class 'module'>
   - get_fp32_math_mode: <class 'function'>
   - glob: <class 'module'>
   - has_cpu: <class 'function'>
   - has_xpu: <class 'function'>
   - intel_extension_for_pytorch: <class 'module'>
   - ipex_version: <class 'str'>
   - is_loaded: <class 'bool'>
   - jit: <class 'module'>
   - kernel32: <class 'ctypes.WinDLL'>
   - last_error: <class 'int'>
   - llm: <class 'module'>
   - logger: <class 'intel_extension_for_pytorch.utils._logger._Logger'>
   - matches: <class 're.Match'>
   - nn: <class 'module'>
   - optim: <class 'module'>
   - optimize: <class 'function'>
   - optimize_transformers: <class 'function'>
   - os: <class 'module'>
   - path_patched: <class 'bool'>
   - pfiles_path: <class 'str'>
   - platform: <class 'module'>
   - prev_error_mode: <class 'int'>
   - proxy_compute_eng: <class 'type'>
   - proxy_log_level: <class 'type'>
   - proxy_math_mode: <class 'type'>
   - py_dll_path: <class 'str'>
   - quantization: <class 'module'>
   - re: <class 'module'>
   - res: <class 'int'>
   - set_fp32_math_mode: <class 'function'>
   - sys: <class 'module'>
   - th_dll_path: <class 'str'>
   - torch_version: <class 'str'>
   - transformers: <class 'module'>
   - utils: <class 'module'>
   - with_load_library_flags: <class 'bool'>
   - xpu: <class 'module'>

2. 检查优化器相关模块:
   ✓ ipex.optim 存在
      属性示例:

3. 检查具体的优化器类:

4. 检查 torch.xpu 优化器支持:
   ✓ torch.xpu.optim 存在
      包含:

5. 尝试创建优化器测试:
   ✓ XPU 可用,在 XPU 上测试
   ✓ 标准 torch.optim.AdamW: 创建成功
      优化器类型: <class 'torch.optim.adamw.AdamW'>
   ✗ IPEX 优化器 (尝试 ipex.optim): 不可用
   ✗ IPEX 优化器 (尝试 ipex.optimizers): 不可用

6. 检查 IPEX 优化函数:
   ✓ ipex.optimize 存在
   ✓ ipex.optimize 应用成功

=== 诊断完成 ===

关键点:Intel IPEX的策略是优化现有优化器,而不是提供新的优化器类。所以正确的做法是先用torch创建优化器,再用ipex优化它。🚀 优化器创建流程总结根据诊断结果,正确的XPU优化器创建流程是:
  1. 使用标准torch.optim.AdamW创建优化器
  2. 使用ipex.optimize()对模型和优化器进行优化
  3. 返回优化后的优化器
这就是为什么之前会失败:代码试图调用不存在的ipex.optim.AdamW,但实际上IPEX不提供单独的AdamW类,而是通过ipex.optimize()函数来优化现有的优化器。

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 234

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Please Log in or Create an account to join the conversation.


Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323

Deprecated: Using null as the key parameter for array_key_exists() is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/cbPluginHandler.php on line 323
  • service
  • [service]
  • Topic Author

  • Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

    Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239
    Offline
  • Administrator
  • Administrator
More
31 Jan 2026 08:13 #1117 by service
完整修复的trainer_utils.py (llama factory)
Code:
def _create_xpu_optimizer(     model: "PreTrainedModel",     training_args: "TrainingArguments",     finetuning_args: "FinetuningArguments", ) -> Optional["torch.optim.Optimizer"]:     """创建 XPU 优化器 - 修复版本(基于诊断结果)"""     if not is_xpu_available():         return None          try:         # 检查并导入 IPEX         try:             import intel_extension_for_pytorch as ipex             ipex_available = True         except ImportError as e:             logger.warning_rank0(f"无法导入 Intel IPEX: {e}")             ipex_available = False                  # 获取可训练参数         decay_params, nodecay_params = [], []         decay_param_names = _get_decay_parameter_names(model)         for name, param in model.named_parameters():             if param.requires_grad:                 if name in decay_param_names:                     decay_params.append(param)                 else:                     nodecay_params.append(param)                  # 创建参数组         param_groups = [             dict(params=nodecay_params, weight_decay=0.0),             dict(params=decay_params, weight_decay=training_args.weight_decay),         ]                  # 确定数据类型         if training_args.fp16:             dtype = torch.float16         elif training_args.bf16:             dtype = torch.bfloat16         else:             dtype = torch.float32                  # Windows XPU 特殊处理         if torch.xpu.is_available() and hasattr(torch.xpu, 'device_count'):             logger.info_rank0(f"Windows XPU 环境:使用 XPU 设备,数据类型 {dtype}")                  # 创建优化器         if training_args.optim == "adamw_torch":             # 使用标准 torch AdamW             optimizer = torch.optim.AdamW(                 param_groups,                 lr=training_args.learning_rate,                 betas=(training_args.adam_beta1, training_args.adam_beta2),                 eps=training_args.adam_epsilon,                 weight_decay=training_args.weight_decay,             )                          # 如果 IPEX 可用,应用优化             if ipex_available:                 try:                     # 应用 IPEX 优化                     model, optimizer = ipex.optimize(                         model,                         optimizer=optimizer,                         dtype=dtype,                         level='O1',  # 基本优化级别                         auto_kernel_selection=True                     )                     logger.info_rank0("XPU 优化器:使用 torch.optim.AdamW + ipex.optimize 优化")                 except Exception as ipex_err:                     logger.warning_rank0(f"ipex.optimize 失败,使用标准优化器: {ipex_err}")                     # 回退到标准优化器             else:                 logger.info_rank0("XPU 优化器:使用标准 torch.optim.AdamW (IPEX 不可用)")                          return optimizer                      else:             # 其他优化器             optim_class, optim_kwargs = Trainer.get_optimizer_cls_and_kwargs(training_args)             optimizer = optim_class(param_groups, **optim_kwargs)                          # 如果 IPEX 可用,尝试优化             if ipex_available:                 try:                     model, optimizer = ipex.optimize(                         model,                         optimizer=optimizer,                         dtype=dtype                     )                     logger.info_rank0(f"XPU 优化器:使用 {training_args.optim} + ipex.optimize 优化")                 except:                     logger.info_rank0(f"XPU 优化器:使用标准 {training_args.optim} (IPEX 优化失败)")                          return optimizer                  except Exception as e:         logger.warning_rank0(f"创建 XPU 优化器失败: {e}")         # 回退到标准优化器         try:             return torch.optim.AdamW(                 model.parameters(),                 lr=training_args.learning_rate,                 betas=(training_args.adam_beta1, training_args.adam_beta2),                 eps=training_args.adam_epsilon,                 weight_decay=training_args.weight_decay,             )         except:             return None
 

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 189

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 237

Deprecated: Using null as an array offset is deprecated, use an empty string instead in /var/www/html/libraries/CBLib/CB/Legacy/LegacyFoundationFunctions.php on line 239

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum
FaLang translation system by Faboba

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100
mysqli object is already closed (500 Whoops, looks like something went wrong.)

Error

HTTP 500 Whoops, looks like something went wrong.

mysqli object is already closed

Exception

Error

  1. */
  2. public function disconnect()
  3. {
  4. // Close the connection.
  5. if (\is_callable([$this->connection, 'close'])) {
  6. $this->connection->close();
  7. }
  8. parent::disconnect();
  9. }
  1. */
  2. public function disconnect()
  3. {
  4. // Close the connection.
  5. if (\is_callable([$this->connection, 'close'])) {
  6. $this->connection->close();
  7. }
  8. parent::disconnect();
  9. }
  1. *
  2. * @since 2.0.0
  3. */
  4. public function __destruct()
  5. {
  6. $this->disconnect();
  7. }
  8. /**
  9. * Alter database's character set.
  10. *
DatabaseDriver->__destruct()

Stack Trace

Error
Error:
mysqli object is already closed

  at /var/www/html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:318
  at mysqli->close()
     (/var/www/html/libraries/vendor/joomla/database/src/Mysqli/MysqliDriver.php:318)
  at Joomla\Database\Mysqli\MysqliDriver->disconnect()
     (/var/www/html/libraries/vendor/joomla/database/src/DatabaseDriver.php:496)
  at Joomla\Database\DatabaseDriver->__destruct()                

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100

Deprecated: Method ReflectionProperty::setAccessible() is deprecated since 8.5, as it has no effect since PHP 8.1 in /var/www/html/plugins/system/falangdriver/falangdriver.php on line 100