private void createGlobalRankProfiles(DeployState deployState) {
        var importedModels = deployState.getImportedModels().all();
        DeployLogger deployLogger = deployState.getDeployLogger();
        RankProfileRegistry rankProfileRegistry = deployState.rankProfileRegistry();
        QueryProfiles queryProfiles = deployState.getQueryProfiles();
        List <Future<ConvertedModel>> futureModels = new ArrayList<>();
        if ( ! importedModels.isEmpty()) { // models/ directory is available
            for (ImportedMlModel model : importedModels) {
                // Due to automatic naming not guaranteeing unique names, there must be a 1-1 between OnnxModels and global RankProfiles.
                RankProfile profile = new RankProfile(model.name(), null, applicationPackage,
                                                      deployLogger, rankProfileRegistry);
                addOnnxModelInfoFromSource(model, profile);
                rankProfileRegistry.add(profile);
                futureModels.add(deployState.getExecutor().submit(() -> {
                    ConvertedModel convertedModel = ConvertedModel.fromSource(applicationPackage, new ModelName(model.name()),
                                                                              model.name(), profile, queryProfiles.getRegistry(), model);
                    convertedModel.expressions().values().forEach(f -> profile.addFunction(f, false));
                    return convertedModel;
                }));
            }
        }
        else { // generated and stored model information may be available instead
            ApplicationFile generatedModelsDir = applicationPackage.getFile(ApplicationPackage.MODELS_GENERATED_REPLICATED_DIR);
            for (ApplicationFile generatedModelDir : generatedModelsDir.listFiles()) {
                String modelName = generatedModelDir.getPath().last();
                if (modelName.contains(".")) continue; // Name space: Not a global profile
                // Due to automatic naming not guaranteeing unique names, there must be a 1-1 between OnnxModels and global RankProfiles.
                RankProfile profile = new RankProfile(modelName, null, applicationPackage,
                                                      deployLogger, rankProfileRegistry);
                addOnnxModelInfoFromStore(modelName, profile);
                rankProfileRegistry.add(profile);
                futureModels.add(deployState.getExecutor().submit(() -> {
                    ConvertedModel convertedModel = ConvertedModel.fromStore(applicationPackage, new ModelName(modelName), modelName, profile);
                    convertedModel.expressions().values().forEach(f -> profile.addFunction(f, false));
                    return convertedModel;
                }));
            }
        }
        for (var futureConvertedModel : futureModels) {
            try {
                futureConvertedModel.get();
            } catch (ExecutionException | InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
        new Processing(deployState.getProperties()).processRankProfiles(deployLogger, rankProfileRegistry, queryProfiles, true, false);
    }
Creates a rank profile not attached to any search definition, for each imported model in the application package,
and adds it to the given rank profile registry.
config-model/src/main/java/com/yahoo/vespa/model/VespaModel.java