diff --git a/backprop/optimizer.cc b/backprop/optimizer.cc index 4302f9c..673a96b 100644 --- a/backprop/optimizer.cc +++ b/backprop/optimizer.cc @@ -19,7 +19,6 @@ #include #include "gemma/common.h" -#include "gemma/configs.h" #include "gemma/weights.h" #include "hwy/contrib/thread_pool/thread_pool.h" diff --git a/gemma/gemma.cc b/gemma/gemma.cc index ed8c36b..f0543bc 100644 --- a/gemma/gemma.cc +++ b/gemma/gemma.cc @@ -194,10 +194,8 @@ GemmaTokenizer::GemmaTokenizer(const Path& tokenizer_path) { impl_ = std::make_unique(tokenizer_path); } -GemmaTokenizer::GemmaTokenizer() { - impl_ = std::make_unique(); -} - +// Default suffices, but they must be defined after GemmaTokenizer::Impl. +GemmaTokenizer::GemmaTokenizer() = default; GemmaTokenizer::~GemmaTokenizer() = default; GemmaTokenizer::GemmaTokenizer(GemmaTokenizer&& other) = default; GemmaTokenizer& GemmaTokenizer::operator=(GemmaTokenizer&& other) = default; diff --git a/gemma/run.cc b/gemma/run.cc index af86dd8..3538184 100644 --- a/gemma/run.cc +++ b/gemma/run.cc @@ -35,10 +35,14 @@ #include "hwy/highway.h" #include "hwy/per_target.h" #include "hwy/profiler.h" +#include "hwy/timer.h" #if (!defined(HWY_VERSION_LT) || HWY_VERSION_LT(1, 2)) && !HWY_IDE #error "Please update to version 1.2 of github.com/google/highway." #endif +#if HWY_CXX_LANG < 201703L +#error "Gemma.cpp requires C++17, please pass -std=c++17." +#endif static constexpr bool kVerboseLogTokens = false; @@ -68,8 +72,12 @@ void ShowConfig(LoaderArgs& loader, InferenceArgs& inference, AppArgs& app) { << std::thread::hardware_concurrency() << "\n" << "Instruction set : " << hwy::TargetName(hwy::DispatchedTarget()) << " (" - << hwy::VectorBytes() * 8 << " bits)" << "\n" - << "Compiled config : " << CompiledConfig() << "\n" + << hwy::VectorBytes() * 8 << " bits)" << "\n"; + char cpu100[100]; + if (hwy::platform::GetCpuString(cpu100)) { + std::cout << "CPU : " << cpu100 << "\n"; + } + std::cout << "Compiled config : " << CompiledConfig() << "\n" << "Weight Type : " << gcpp::StringFromType(loader.WeightType()) << "\n" << "EmbedderInput Type : "