From 659f59e22adfb4e966860fbe3406c5aac8c50acc Mon Sep 17 00:00:00 2001 From: Han Yin Date: Fri, 29 Aug 2025 15:24:52 -0700 Subject: [PATCH] UI: update Arm features indicator; fix the broken hyperlinks --- .../ui/components/ArmFeaturesVisualizer.kt | 2 - .../llama/ui/screens/SettingsGeneralScreen.kt | 42 ++++++++----------- .../java/android/llama/cpp/ArmFeatures.kt | 12 +++--- 3 files changed, 23 insertions(+), 33 deletions(-) diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ArmFeaturesVisualizer.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ArmFeaturesVisualizer.kt index 8cc6f1fe37..584e653f6e 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ArmFeaturesVisualizer.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/components/ArmFeaturesVisualizer.kt @@ -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, diff --git a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/SettingsGeneralScreen.kt b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/SettingsGeneralScreen.kt index 844acaec0c..bc34c09d46 100644 --- a/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/SettingsGeneralScreen.kt +++ b/examples/llama.android/app/src/main/java/com/example/llama/ui/screens/SettingsGeneralScreen.kt @@ -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) ) } } diff --git a/examples/llama.android/llama/src/main/java/android/llama/cpp/ArmFeatures.kt b/examples/llama.android/llama/src/main/java/android/llama/cpp/ArmFeatures.kt index a915391cb6..6566233fcb 100644 --- a/examples/llama.android/llama/src/main/java/android/llama/cpp/ArmFeatures.kt +++ b/examples/llama.android/llama/src/main/java/android/llama/cpp/ArmFeatures.kt @@ -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" ) )