Optaplanner – 处理器是否影响计算时间

huangapple go评论80阅读模式
英文:

Optaplanner - does processor impacts the compute time

问题

我们在一个项目中使用Optaplanner已经有4-5年了。随着业务需求的增长,我们添加了越来越多的规则。但现在我们达到了一个阶段,在我们的服务器上生成一个可接受的结果需要大约10天的时间。我们已经尝试过优化规则、源代码等,但效果很小。这意味着我们决定尝试在另一台计算机上(在云上)运行项目并生成一个计划,我们选择了一台具有明显更好硬件(CPU方面)的虚拟机。我们测量到每秒处理的解决方案要多得多(这是好事),然而,与我们的服务器相比,最佳分数似乎并没有真正随时间的推移而表现得更好。因此,最终,我们有些疑惑,CPU(使用体面的CPU)是否真的很重要?如果是的话,那么在选择要运行Optaplanner Solver的CPU时,我们应该寻找什么规格?

请注意,我们使用的是Optaplanner的V8.x版本,计划迁移到v9.x。

英文:

We are using Optaplanner in a project for 4-5 years now. As the business requirements grow we added a more and more rules. But now we are at a point where it takes around 10 days to generate an acceptable result on our server. We have already tried to optimize the rules, the source code, etc. with little positive impact. That means we decided to try running the projet and generate a planning with another computer (on the cloud), we picked a VM with significative better hardware (CPU wise). We measured that a lot more solution are processed per seconds (which is good), yet, the best scores does not seem to really outperform over time compared to our server... So in the end, we are kind of wondering if the CPU (when using decent ones) really matter? If so, what specifications should we looking for when picking a CPU to run an Optaplanner Solver ?

Note, we are at V8.x of optaplanner, we plan to migrate to v9.x.

答案1

得分: 2

CPU性能对OptaPlanner(或Timefold)的性能产生了巨大影响,因为工作负载完全受限于CPU。要取得成功,您需要尽可能多地查看搜索空间,而具有更强大的CPU将使您能够更快地完成相同数量的工作。

(如果您纯粹追求CPU性能,您可能会对听到Timefold默认情况下比OptaPlanner快得多感兴趣。)

然而,CPU性能并非全部。例如,如果您的解决方案包含分数陷阱,求解器将永远无法找到更好的解决方案,无论它尝试多么努力,或者持续多长时间。如果您认为在CPU性能方面已经达到了边际回报的点,请开始查找约束中的问题。

是否有足够的移动次数,以及是否有足够的移动多样性,以允许求解器摆脱局部最优解?您的约束中是否存在分数陷阱?我无法为您回答这些问题。但这些将是我投入寻找答案的问题。

实际上,我们在文档中有一个完整的章节来解决从求解器中获得更好结果的问题

英文:

CPU power makes massive impact on the performance of OptaPlanner (or Timefold), as the workload is entirely CPU-bound. To be successful, you need to look at as much of the search space as possible, and with a more powerful CPU, you'll get the same amount of work done more quickly.

(If you're purely after CPU power, you may be interested in hearing that Timefold is significantly faster than OptaPlanner by default.)

However, CPU performance is not the full picture. If your solution contains score traps, for example, the solver will never find better solution, no matter how hard it tries, or for how long. If you believe you hit the point of diminishing returns on CPU power, start looking for problems in your constraints.

Is there enough moves, and is there enough move diversity, to allow the solver to escape from local optima? Are there score traps in your constraints? I can not answer those questions for you. But they would be the questions I'd invest into finding the answers to.

In fact, we have an entire chapter in our documentation to deal with the issue of getting better results out of the solver.

huangapple
  • 本文由 发表于 2023年6月22日 20:12:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76531764.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定