Cut the pumpkin flesh into 1 cm (approximately 1/2 inch) cubes.
Peel the ginger, cut in half and place in a saucepan with the cider and a pinch of salt and bring to a boil. Reduce to a simmer and cook 5 minutes. Drain, reserving the liquid and finely chop the ginger. Heat a little of the butter in a skillet and saute the pumpkin until tender, about 10 minutes. Add half of the remaining butter to the pan and sauté the carrot slices briefly. Add the water, salt and pepper and simmer for 5 minutes.
In a bowl, stir together the creme fraiche, cream, egg yolks, salt, pepper, nutmeg, garlic and ginger.
Preheat the oven to 200°C (approximately 390°F). Brush a gratin dish with the remaining butter. Add the pumpkin pieces and the bacon to the dish and pour the cream creme fraiche mixture. Cover with the cheese.
Bake until bubbling and the cheese has melted, about 20 minutes. Garnish with the rosemary and serve.