UI: update Arm features indicator; fix the broken hyperlinks
This commit is contained in:
parent
99d77b618a
commit
659f59e22a
|
|
@ -3,7 +3,6 @@ package com.example.llama.ui.components
|
|||
import android.llama.cpp.ArmFeature
|
||||
import android.llama.cpp.ArmFeaturesMapper.DisplayItem
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.MultiChoiceSegmentedButtonRow
|
||||
import androidx.compose.material3.SegmentedButton
|
||||
|
|
@ -17,7 +16,6 @@ import kotlin.math.sqrt
|
|||
/**
|
||||
* ARM Features visualization using segmented buttons.
|
||||
*/
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ArmFeaturesVisualizer(
|
||||
supportedFeatures: List<DisplayItem>,
|
||||
|
|
|
|||
|
|
@ -124,37 +124,31 @@ fun SettingsGeneralScreen(
|
|||
}
|
||||
|
||||
// ARM Features Visualizer with Tier Information description
|
||||
SettingsCategory(title = "About your device") {
|
||||
Text(
|
||||
text = "ARM Capabilities",
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
|
||||
Text(
|
||||
text = "Hardware-accelerated AI features",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
|
||||
detectedTier?.let { tier ->
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
supportedFeatures?.let {
|
||||
ArmFeaturesVisualizerClickable(supportedFeatures = supportedFeatures)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
}
|
||||
|
||||
detectedTier?.let { tier ->
|
||||
SettingsCategory(title = "About your device") {
|
||||
Text(
|
||||
text = "Optimization Tier: ${tier.name}",
|
||||
text = "AI Accelerated by Arm®",
|
||||
style = MaterialTheme.typography.titleMedium
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
|
||||
Text(
|
||||
text = tier.description,
|
||||
text = "Available hardware capabilities on your device are highlighted below:",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(top = 4.dp)
|
||||
modifier = Modifier.padding(top = 4.dp, bottom = 8.dp)
|
||||
)
|
||||
|
||||
supportedFeatures?.let {
|
||||
ArmFeaturesVisualizerClickable(supportedFeatures = it)
|
||||
}
|
||||
|
||||
Text(
|
||||
text = "Tap a feature above to learn more about how it accelerates Generative AI!",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(top = 8.dp, bottom = 4.dp)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,39 +25,37 @@ object ArmFeaturesMapper {
|
|||
|
||||
/**
|
||||
* All ARM features supported by the library, in order of introduction.
|
||||
*
|
||||
* TODO-han.yin: fix the broken hyperlinks above!
|
||||
*/
|
||||
val allFeatures = listOf(
|
||||
ArmFeature(
|
||||
name = "ASIMD",
|
||||
displayName = "ASIMD",
|
||||
description = "Advanced SIMD (NEON) - baseline vectorization",
|
||||
armDocUrl = "https://developer.arm.com/architectures/instruction-sets/simd-isas/neon"
|
||||
armDocUrl = "https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/matrix-matrix-multiplication-neon-sve-and-sme-compared"
|
||||
),
|
||||
ArmFeature(
|
||||
name = "DOTPROD",
|
||||
displayName = "DOTPROD",
|
||||
description = "Dot Product instructions for neural networks",
|
||||
armDocUrl = "https://developer.arm.com/architectures/instruction-sets/intrinsics/dotprod"
|
||||
armDocUrl = "https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/exploring-the-arm-dot-product-instructions"
|
||||
),
|
||||
ArmFeature(
|
||||
name = "I8MM",
|
||||
displayName = "I8MM",
|
||||
description = "Integer 8-bit Matrix Multiplication",
|
||||
armDocUrl = "https://developer.arm.com/documentation/102107/latest/Matrix-multiplication-instructions"
|
||||
armDocUrl = "https://community.arm.com/arm-community-blogs/b/ai-blog/posts/optimize-llama-cpp-with-arm-i8mm-instruction"
|
||||
),
|
||||
ArmFeature(
|
||||
name = "SVE",
|
||||
displayName = "SVE",
|
||||
description = "Scalable Vector Extension",
|
||||
armDocUrl = "https://developer.arm.com/architectures/instruction-sets/simd-isas/sve"
|
||||
armDocUrl = "https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/sve2"
|
||||
),
|
||||
ArmFeature(
|
||||
name = "SME",
|
||||
displayName = "SME",
|
||||
description = "Scalable Matrix Extension",
|
||||
armDocUrl = "https://developer.arm.com/architectures/instruction-sets/simd-isas/sme"
|
||||
armDocUrl = "https://newsroom.arm.com/blog/scalable-matrix-extension"
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue