nit: append `®` to all `Arm` labels
This commit is contained in:
parent
5f06978945
commit
a4459b22d1
|
|
@ -3,7 +3,7 @@ package com.example.llama
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import dagger.hilt.android.HiltAndroidApp
|
import dagger.hilt.android.HiltAndroidApp
|
||||||
|
|
||||||
const val APP_NAME = "Arm AI Playground"
|
const val APP_NAME = "Arm® AI Playground"
|
||||||
|
|
||||||
@HiltAndroidApp
|
@HiltAndroidApp
|
||||||
class KleidiLlamaApplication : Application()
|
class KleidiLlamaApplication : Application()
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,7 @@ private fun ImportFromHuggingFaceDialog(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
text = models?.let {
|
text = models?.let {
|
||||||
"The Hugging Face models shown here have been pre-filtered to be moderately sized and correctly quantized.\n\n" +
|
"The Hugging Face models shown here have been pre-filtered to be moderately sized and correctly quantized.\n\n" +
|
||||||
"Please use responsibly. We do not endorse or take responsibility for misuse or harmful use of these models.\n\n" +
|
"Please use responsibly. Arm® does not endorse or take responsibility for misuse or harmful use of these models.\n\n" +
|
||||||
"Select a model to download:"
|
"Select a model to download:"
|
||||||
} ?: "Searching on HuggingFace for open-source models free for downloading...",
|
} ?: "Searching on HuggingFace for open-source models free for downloading...",
|
||||||
style = MaterialTheme.typography.bodyLarge,
|
style = MaterialTheme.typography.bodyLarge,
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package android.llama.cpp
|
package android.llama.cpp
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an ARM CPU feature with its metadata.
|
* Represents an Arm® CPU feature with its metadata.
|
||||||
*/
|
*/
|
||||||
data class ArmFeature(
|
data class ArmFeature(
|
||||||
val name: String,
|
val name: String,
|
||||||
|
|
@ -11,7 +11,7 @@ data class ArmFeature(
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helper class to map LLamaTier to supported ARM features.
|
* Helper class to map LLamaTier to supported Arm® features.
|
||||||
*/
|
*/
|
||||||
object ArmFeaturesMapper {
|
object ArmFeaturesMapper {
|
||||||
|
|
||||||
|
|
@ -24,7 +24,7 @@ object ArmFeaturesMapper {
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All ARM features supported by the library, in order of introduction.
|
* All Arm® features supported by the library, in order of introduction.
|
||||||
*/
|
*/
|
||||||
val allFeatures = listOf(
|
val allFeatures = listOf(
|
||||||
ArmFeature(
|
ArmFeature(
|
||||||
|
|
@ -59,20 +59,6 @@ object ArmFeaturesMapper {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
|
||||||
* Maps a LLamaTier to its supported ARM features.
|
|
||||||
* Returns a list of booleans where each index corresponds to allFeatures.
|
|
||||||
*/
|
|
||||||
fun getSupportedFeatures(tier: LLamaTier?): List<Boolean>? =
|
|
||||||
when (tier) {
|
|
||||||
LLamaTier.NONE, null -> null // No tier detected
|
|
||||||
LLamaTier.T0 -> listOf(true, false, false, false, false) // ASIMD only
|
|
||||||
LLamaTier.T1 -> listOf(true, true, false, false, false) // ASIMD + DOTPROD
|
|
||||||
LLamaTier.T2 -> listOf(true, true, true, false, false) // ASIMD + DOTPROD + I8MM
|
|
||||||
LLamaTier.T3 -> listOf(true, true, true, true, false) // ASIMD + DOTPROD + I8MM + SVE
|
|
||||||
// TODO-han.yin: implement T4 once obtaining an Android device with SME!
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the feature support data for UI display.
|
* Gets the feature support data for UI display.
|
||||||
*/
|
*/
|
||||||
|
|
@ -87,4 +73,18 @@ object ArmFeaturesMapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Maps a LLamaTier to its supported Arm® features.
|
||||||
|
* Returns a list of booleans where each index corresponds to allFeatures.
|
||||||
|
*/
|
||||||
|
private fun getSupportedFeatures(tier: LLamaTier?): List<Boolean>? =
|
||||||
|
when (tier) {
|
||||||
|
LLamaTier.NONE, null -> null // No tier detected
|
||||||
|
LLamaTier.T0 -> listOf(true, false, false, false, false) // ASIMD only
|
||||||
|
LLamaTier.T1 -> listOf(true, true, false, false, false) // ASIMD + DOTPROD
|
||||||
|
LLamaTier.T2 -> listOf(true, true, true, false, false) // ASIMD + DOTPROD + I8MM
|
||||||
|
LLamaTier.T3 -> listOf(true, true, true, true, false) // ASIMD + DOTPROD + I8MM + SVE
|
||||||
|
// TODO-han.yin: implement T4 once obtaining an Android device with SME!
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ interface TierDetection {
|
||||||
* Higher tiers provide better performance on supported hardware.
|
* Higher tiers provide better performance on supported hardware.
|
||||||
*/
|
*/
|
||||||
enum class LLamaTier(val rawValue: Int, val libraryName: String, val description: String) {
|
enum class LLamaTier(val rawValue: Int, val libraryName: String, val description: String) {
|
||||||
NONE(-404, "", "No valid Arm optimization available!"),
|
NONE(-404, "", "No valid Arm® optimization available!"),
|
||||||
T0(0, "llama_android_t0", "ARMv8-a baseline with ASIMD"),
|
T0(0, "llama_android_t0", "ARMv8-a baseline with ASIMD"),
|
||||||
T1(1, "llama_android_t1", "ARMv8.2-a with DotProd"),
|
T1(1, "llama_android_t1", "ARMv8.2-a with DotProd"),
|
||||||
T2(2, "llama_android_t2", "ARMv8.6-a with DotProd + I8MM"),
|
T2(2, "llama_android_t2", "ARMv8.6-a with DotProd + I8MM"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue