もくじIndex

イメージでわかる fallback

Visual Guide to Fallback Paths

Visual Guide to Fallback Paths

シリーズ: イメージでわかる

新しい近道が使えなくても、別の経路で動けることがある。そんな fallback の考え方をやさしく説明するページです。

Even when new shortcuts aren't available, there are often alternative routes that still work. A gentle guide to the concept of fallback paths.

1. fallback ってなに?

1. What Is a Fallback?

「最善の方法が使えないとき、代わりの方法を使うこと」です。

"Using an alternative method when the best one isn't available."

通学路の橋が工事中だったら、少し遠回りの別の道を通りますよね。到着する場所は同じだけど、時間はちょっとかかる。

If the bridge on your school route is under construction, you take a slightly longer detour. You still arrive at the same place, but it takes a bit more time.

ソフトウェアの世界にもこれと同じしくみがあります。GPU に計算を頼むとき、「最速の専用ルート」が使えなくても、「遅いけど確実に動く一般ルート」で結果を出せることがある。これを fallback(フォールバック) と呼びます。

The same mechanism exists in software. When sending computations to a GPU, if the "fastest dedicated route" isn't available, there might be a "slower but reliable general route" that still produces results. This is called a fallback.

🛣️ たとえ話: 🛣️ Analogy: 高速道路(専用レーン)が通行止めでも、一般道(fallback 経路)を使えば目的地には着ける。時間は余分にかかるけれど、「着けない」わけではない。 Even if the highway (dedicated lane) is closed, you can use surface streets (fallback route) to reach your destination. It takes longer, but you still get there.

2. 「速い道」と「遅い道」

2. The "Fast Road" and the "Slow Road"

🏎️

専用高速パス

Dedicated Fast Path

その GPU 向けに最適化された計算ルート。速い。でも新しい GPU にしかないことがある。

A computation route optimized for that specific GPU. Fast. But sometimes only available on newer GPUs.

🚗

fallback(一般道)

Fallback (General Route)

どの GPU でも使える汎用ルート。遅いかもしれないけど、幅広い GPU で動く。

A general-purpose route that works on most GPUs. May be slower, but runs on a wide range of hardware.

MIOpen(AI計算のライブラリ)を例にすると:
最新の GPU(MI200 など)には 専用の solver が何十種類も用意されています。gfx900(Vega)ではそのうちの一部しか使えないことがあります。

Take MIOpen (the AI computation library) as an example:
The latest GPUs (like MI200) have dozens of dedicated solvers available. On gfx900 (Vega), only some of these may be usable.

でも、MIOpen は「使える solver のリスト」を GPU の能力に応じて自動で調べ、使えるものの中からいちばん速いものを選びます。専用高速パスがなければ、使える汎用的な solver で計算する。これが fallback です。

However, MIOpen automatically discovers the "list of usable solvers" based on GPU capabilities and picks the fastest available one. If a dedicated fast solver isn't available, it falls back to a general-purpose solver. That's the fallback in action.

3. 「できること」ベースの設計

3. Capability-Based Design

fallback がうまく働く背景には、ある設計思想があります。

Fallback works well because of an underlying design philosophy.

ROCm のライブラリの多くは、GPU の「名前」ではなく「できること」で判断する設計になっています。これを capability-based design(ケイパビリティ・ベースド・デザイン)と呼びます。

Many ROCm libraries make decisions based on what a GPU can do, not what its name is. This is called capability-based design.

イメージとしては、面接で「出身校はどこ?」ではなく「何ができる?」で判断するやり方です。gfx900 は古い GPU ですが、「この機能が使えるなら、この計算はできる」という形で仕事をもらえることがあります。

Think of it as a job interview that asks "What can you do?" instead of "Where did you graduate?" gfx900 is an older GPU, but if it has the required capabilities, it can still get the job done.

💡 ポイント: 💡 Key point: capability-based design のおかげで、gfx900 は正式なサポートリストから外れた後も、一部の計算パスではまだ動くことがあるのです。「名前で弾かれない」設計が、結果として古い GPU を延命させている。 Thanks to capability-based design, gfx900 can still run some computation paths even after being removed from official support lists. A design that doesn't reject by name ends up extending the life of older GPUs.

4. fallback にも限界がある

4. Fallback Has Limits

fallback は万能ではありません。いくつかの大事な限界があります。

Fallback isn't magic. It has important limitations.

① 遅いことがある。 専用パスが 1秒で終わる計算が、fallback では 10秒かかることも珍しくありません。

① It can be slow. A computation that takes 1 second on a dedicated path might take 10 seconds via fallback.

② すべてに fallback があるわけではない。 新しい命令セットが絶対に必要な機能には、代替ルート自体が存在しないことがあります。

② Not everything has a fallback. Features that absolutely require new instruction sets may have no alternative route at all.

③ テストされていないことがある。 fallback 経路は「動くはず」でも、古い GPU では実際にテストされていない場合があります。予期しないクラッシュのリスクがあります。

③ It may not be tested. A fallback path "should work," but if nobody actually tested it on older GPUs, unexpected crashes may occur.

🗺️ たとえ話: 🗺️ Analogy: 地図アプリが提案する迂回路は「たぶん通れる」けど、実際に走ってみたら工事中や通行止めだった、ということがあるのと同じです。fallback もそういうリスクがあります。 A map app might suggest a detour that "should work," but when you actually drive it, there's construction or a road closure. Fallback paths carry the same kind of risk.

5. まとめ

5. Summary

fallback — 最善の道が使えないとき、代わりの道で結果を出すしくみ。

Fallback — A mechanism that uses an alternative path when the best one isn't available.

capability-based design — GPU を名前ではなく「できること」で判断する設計。これが fallback を可能にしている。

Capability-based design — Judging a GPU by what it can do, not its name. This is what makes fallback possible.

限界もある — 遅い、全部ではない、テスト不足のリスク。「動く」と「快適」は別の話。

There are limits — Slower, not universal, risk of untested paths. "It runs" and "it's comfortable" are different things.